How can I disable/enable time and date, for example 07/07/2022 12:00PM is off but on 08/07/2022? I want disable time by date but I can not why?
Below is an example which enables/disables the button according to the specified enableTime and disableTime(I'm disabling/enabling BtnExit) this my script function
$(document).ready(function() {
if (localStorage.getItem("itmEmployee") == "12:00PM")
$("#employed_v0").prop("checked", true);
else
$("#employed_v1").prop("checked", true);
if (localStorage.getItem("itmEmployee") == "12:00PM")
$('#datetimepicker').datetimepicker({
format: 'DD/MM/YYYY'
});
if (localStorage.getItem("itmEmployee") == "12:00PM")
$("#12").prop("disabled", false);
else
$("#12").prop("disabled", true);
$("#12").val(localStorage.getItem("itmTest"));
$("[name=employed]").on("change", function() {
localStorage.setItem("itmEmployee", $(this).val());
if ($(this).val() == "12:00PM")
$("#12").prop("disabled", false);
else
$("#12").prop("disabled", true);
});
$("#12").on("change", function() {
localStorage.setItem("itmTest", $(this).val());
});
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<label>Date<span>*</span></label>
<input id="datepicker" name="r_date" type="date" required> here we will close it using checkbox
<input type="checkbox" name="employed" id="employed_v1" value="12:00PMM" /> 12:00 PM disable
<input type="checkbox" name="employed" id="employed_v0" value="12:00PM" /> 12:00 PM enable
<select id="all">
<option>Select</option>
<option id="12">12:00 PM</option>
</select>
</div>