In Advanced custom fields, I would like to customise the date picker so that, ideally, I can only select a year in the 1500s/1600s but at the very least allow the datepicker to go back to the 1500s. At present it only goes to 19 something.
Would anyone know how I’d implement this?
You can do this by customizing the plugin.
You’ll want to find
timepicker.js
in/wp-content/plugins/acf-field-date-time-picker/js/timepicker.js
And change line 21:
to your preferred range, for example:
This gives you a dropdown that, by default, goes back 500 years and forth 100, from the current year.
Or you can hardcode a specific range like this, to fit your specific needs:
Of course these will be overridden if the plugin gets updated, but it’s a quick fix to your current issue.
The whole code-block looks like this by default: