I have a date select field using WPForms and need to take out some dates. I already disabled all Sundays via the WPForm Setups, but I need to remove a specific date.
I am using this function - the minDate and maxDate work perfectly fine. Why can't I manage the disable thing?
<script>
var form2 = document.getElementById('wpforms-form-3375');
if(form2 != null){
window.wpforms_datepicker = {
disableMobile: true,
disable: ["2023-11-09", "2023-12-02", new Date('December 1, 2023')],
minDate: new Date('October 30, 2023'),
maxDate: new Date('December 2, 2023')
}
}
</script>
<?php } ?>
<?php add_action( 'wpforms_wp_footer_end', 'form2Limits', 10 ); ?>
I tried using disable: ["2023-11-09", "2023-12-02", new Date('December 1, 2023')], no result
Your code should work correctly
Flatpickr documentation: https://flatpickr.js.org/examples/#disabling-specific-dates
Snippet Example: