Home › Forums › Feature Requests › Block days datepicker › Reply To: Block days datepicker
The following jQuery snippet will block all days except Friday (I’m using it for a week-ending form).
You could try returning the day of the week (in this case 5) or the date as a PHP variable from an ACF custom field.
https://stackoverflow.com/questions/19395558/highlight-disable-specific-days-in-jquery-ui-datepicker shows examples of formatting for specific dates.
jQuery(document).ready(function() {
$datepicker = jQuery('.rdsn-week-ending .hasDatepicker');
$datepicker.datepicker( 'option', {
beforeShowDay: function(date) {
if (date.getDay() == 5) {
return [true, ''];
} else {
return [false, ''];
}
}
});
});
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.