I'm hoping someone here can help me with the following: -
Currently, I have the following script for my datepicker snippet where I have excluded Sundays.
<script>
window.onload = function() {
if (window.jQuery) {
let $ = window.jQuery;
$(function() {
$("#date").datepicker({
dateFormat: 'dd/mm/yy',
minDate: +1,
maxDate: '+2M',
beforeShowDay: function(date) {
var day = date.getDay();
return [(day != 0), ''];
}
});
});
}
}
I would like to add the following conditions: -
- Exclude multiple specific dates (i.e. 16/04/21, etc.)
- Disable next business day selection by customers AFTER 12pm.
For point #2, I have the following code but am unsure of where to include it in the above: -
$("#date" ).datepicker({
minDate: +1,
beforeShow : function(){
var dateTime = new Date();
var hour = dateTime.getHours();
if(hour >= 12){
$(this).datepicker( "option", "minDate", "+2" );
}
}
Please let me know, thank you!