let order_datepicker = function() { let dateFormat = 'yy-mm-dd'; let disableDates = ['2025-12-07']; $('.datepicker').datepicker({ changeYear: true, changeMonth: true, beforeShow: function(input, inst) { var calendar = inst.dpDiv; setTimeout(function() { calendar.position({ my: 'left top', at: 'left bottom', of: input }); }, 1); }, dateFormat: dateFormat, minDate: '0d', maxDate: '+7d', beforeShowDay : function(date) { var disableDate = $.datepicker.formatDate(dateFormat, date); if (disableDates.indexOf(disableDate) !== -1) { return [false, '']; } return [true, '']; }, }); }