Does anyone know how to add a filter in the datepicker so the user can only choose a date starting 2 days in the future EXCLUDING the weekends.
So if today is Thursday, the next available date is Monday.
I have used this code:
gform.addFilter( 'gform_datepicker_options_pre_init', function( optionsObj, formId, fieldId ) {
if ( formId == 1 && fieldId == 29 ) {
optionsObj.minDate = '+2';
}
return optionsObj;
});
</script>
…but it doesn’t exclude the weekends in it’s calculation, even though, I’ve also used the following code that doesn’t allow the users to choose a weekend date (and it worked just fine for that purpose):
gform.addFilter( 'gform_datepicker_options_pre_init', function( optionsObj, formId, fieldId ) {
if ( formId == 1 && fieldId == 29 ) {
optionsObj.beforeShowDay = jQuery.datepicker.noWeekends;
}
return optionsObj;
});
Any ideas, someone?