Home › Forums › General Issues › Remove seconds from Time Picker › Reply To: Remove seconds from Time Picker
It’s possible to add a JS filter to set the arguments for the jQuery Timepicker instantiation.
Something like the following although I wasn’t able to actually get it working.
(function($) {
acf.add_filter('date_time_picker_args', function( args, $field ){
args.units = ['hour', 'minute'];
return args;
});
})(jQuery);
It’s documented here – https://www.advancedcustomfields.com/resources/adding-custom-javascript-fields/ – but this contradicts the ACF JS API docs which says to use .addFilter
– https://www.advancedcustomfields.com/resources/javascript-api/.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.