Calendar Picker Default to Show Previous Month

For a little background on the jQuery UI Datepicker, which is used by Skuid, see Zach’s community post at this link.

In this case, an Inline Javascript snippet will do the trick.

Go to the Page Builder for the page that requires the previous month as a default. Click on the Resources tab in the Page Builder.

Click on Javascript and then click the button to add a snippet.

Choose In-Line for the Resource Location.

Enter a name for your snippet. In this example, I used PreviousMonth.

In the Resource Body, place the following code:

skuid.$.datepicker.setDefaults({ defaultDate: '-1m' });

Close the code box and click Save!

This snippet will default all of the datepickers for this page  to the previous month. If you want this on other pages, then you can add the snippet to those pages, as well.

Good luck!

-Josh