Hi,
currently the date picker has a range of plus minus 100 years to the current year. But I need more. Is there any filter that could be used to modify this?
Thanks Sascha
I do not know if that is a set-able argument for the date picker. See this for information https://www.advancedcustomfields.com/resources/javascript-api/#filters-date_picker_args
Hi John, thanks for this. It looks like what I’m looking for. Question: Is this filter only available with the pro version? I have a license ready but it would be the only reason to use the pro version 😉 Thanks Sascha
It should be available in the free version. The JS API is the same and should work on any of the field types you have access to.
It works great. FYI for future visitors. The JS must be added AFTER acf-input is added. And example could be:
wp_enqueue_script( get_stylesheet_directory_uri() . 'js/yourfile.js', array( 'jquery', 'acf-input' ), '1.0', false );
Example for JS:
(function( $ ) {
'use strict';
acf.add_filter('date_picker_args', function(args, el) {
args.yearRange = "-1000:+50";
return args;
});
})( jQuery );