Calendar start day [RESOLVED]

Hi, I need for the calendar popup to start on Sunday and I have gotten 3 of 4 date fields to start on Sunday by adding this code
Here is the form. It is the Trash Start Date that still starts on Monday. Weird, right?

gform.addFilter( 'gform_datepicker_options_pre_init', function( optionsObj, formId, fieldId ) {

gform.addFilter( 'gform_datepicker_options_pre_init', function( optionsObj, formId, fieldId ) {
   // Sunday is 0, Monday is 1, etc.
   optionsObj.firstDay = 0;
   return optionsObj;

   return optionsObj;
} );

However, the FIRST date field still starts on Monday. Any thoughts? Thanks much, Dave

Are you using the script exactly as it is posted there, with the nested scripts? That does not look quite right, if you are using it like this.

Yes, I got that code from the gravity forms community. Someone had a similar problem and used it. Funny that it did change 3 of 4 date fields to Sunday, but not the first of the four date fields.

Wow, not being a coder, I did not realize that the code was nested. I deleted what appeared to be duplicate code and guess what? It works correctly! Here is the code I am using:

It appears that my issue is solved. Thanks very much for your insight. Dave

1 Like