I am using a datetimepicker
on my frontend form with below code. I want to limit time selection between range 09:00
to 17:30
<input name="datetime_field" id="datetime_field" readonly title="Appointment Date" value="" placeholder="Date & Time" class="input-text" type="text" data-validate="{required:true}">
script for datetimepicker
,
<script>
require([
"jquery",
"mage/calendar"
], function ($) {
var minHour = 9;
var maxHour = 17;
$("#datetime_field").calendar({
showsTime: true,
hideIfNoPrevNext: true,
buttonText: "<?php echo __('Select Date') ?>",
hourMin: minHour,
hourMax: maxHour,
});
});
</script>
I used minHour
and maxHour
which limits time selection between 09:00
to 17:59
. How can I limit it to 17:30
?