Created
March 25, 2018 07:58
-
-
Save isaumya/ea9eb16bd6fdfe7f47096785d40c451a to your computer and use it in GitHub Desktop.
Disable Sunday in Gravity Form (WordPress) Date Picker section
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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