How to disable weekends in Date picker with script?

How to disable weekends in Date picker with script?

I am using the following script i found in the documentation of Gravity Forms and it used to work. But now it’s not working anymore.

< script >
gform.addFilter( ‘gform_datepicker_options_pre_init’, function( optionsObj, formId, fieldId ) {
// Apply to field 66 only
if ( fieldId == 66 ) {
optionsObj.minDate = 0;
optionsObj.firstDay = 1;
optionsObj.beforeShowDay = jQuery.datepicker.noWeekends;
return optionsObj;
< /script >

Hi Ibrahim. I replied to your support ticket. If you need assistance, please reply there. Thank you.

Hi Chris,

It worked like a charm. Thank you.

One more question. I presume that at the next update the bug will be fixed. Do i have to put everything back as it was before?

Hello. No, you won’t need to remove the snippet. But also, the snippet will no longer be necessary. Remove the snippet once you have updated Gravity Forms to the patched release. Thank you.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.