Skip to content

Instantly share code, notes, and snippets.

@isaumya
Created March 25, 2018 07:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save isaumya/ea9eb16bd6fdfe7f47096785d40c451a to your computer and use it in GitHub Desktop.
Save isaumya/ea9eb16bd6fdfe7f47096785d40c451a to your computer and use it in GitHub Desktop.
Disable Sunday in Gravity Form (WordPress) Date Picker section
gform.addFilter( 'gform_datepicker_options_pre_init', function( optionsObj, formId, fieldId ) {
if ( formId == 8 && fieldId == 2 ) {
optionsObj.firstDay = 1;
optionsObj.beforeShowDay = function(date) {
var day = date.getDay();
return [day != 0,''];
}
}
return optionsObj;
});
// Refer: https://docs.gravityforms.com/gform_datepicker_options_pre_init/#2-no-weekends
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment