Skip to content

Instantly share code, notes, and snippets.

@coulterpeterson
Last active May 31, 2023 15:13
Show Gist options
  • Save coulterpeterson/821404a8d923f4b66bef163efb5c62d5 to your computer and use it in GitHub Desktop.
Save coulterpeterson/821404a8d923f4b66bef163efb5c62d5 to your computer and use it in GitHub Desktop.
Allow Selecting Days From Another Month in Datepicker | Gravity Forms
/**
* Gravity Wiz // Gravity Forms // Allow Selecting Days From Another Month in Datepicker
* https://gravitywiz.com/
*
* Allow days from other months to be selectable in the calendar view.
*
* Instructions:
*
* 1. Install this snippet with our free Custom JavaScript plugin.
* https://gravitywiz.com/gravity-forms-custom-javascript/
*
* Limitations:
*
* Only works with inline date picker right now.
*
*/
// When the page is ready
window.addEventListener('load', function () {
if (document.querySelector('body') !== null) {
jQuery("[id^=datepicker_GFFORMID_]").datepicker( "option", "showOtherMonths", true );
jQuery("[id^=datepicker_GFFORMID_]").datepicker( "option", "selectOtherMonths", true );
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment