Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ash-f/b2dd78f5d3e249197e1c1e87e054522c to your computer and use it in GitHub Desktop.
Save ash-f/b2dd78f5d3e249197e1c1e87e054522c to your computer and use it in GitHub Desktop.
WP Fluent Forms date field advanced date configuration for changing default datepicker date
/* Enter this configuration to Advanced Date Configuration of Date field. change 01/01/1950 to any date. the date is US format. */
{
onOpen: [function(selectedDates, dateStr, instance){
if (dateStr == '') {
instance.jumpToDate('01/01/1950', false);
}
}],
/* Set minimum age.(= 18) delete if you don't limit the age */
maxDate: (new Date().getMonth() + 1) + "/" + new Date().getDate() + "/" + (new Date().getFullYear() - 18)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment