Home › Forums › Front-end Issues › Time Picker Args
seems that the args are not taken into account for the time picker :
function acf_timepicker_input_admin_footer() {
?>
<script type="text/javascript">
acf.add_filter('time_picker_args', function( args, $field ){
if($field.attr('data-key') == 'field_584fd81669c59') {
args.stepMinute = 15;
// return
return args;
});
</script>
<?php
}
add_action('acf/input/admin_footer', 'acf_timepicker_input_admin_footer');
can someone check ?
I’ve just tested your code, and it works correctly on my end. Could you please check if there are any JavaScript error messages on the page? Also, could you please share the JSON export field of your field group so I can check your setup?
Thanks 🙂
Thanks for sharing the export file. I’ve just tested it, and it seems you forgot to close the if statement. Could you please try the following code instead?
function acf_timepicker_input_admin_footer() {
?>
<script type="text/javascript">
acf.add_filter('time_picker_args', function( args, $field ){
if($field.attr('data-key') == 'field_584fd81669c59') {
args.stepMinute = 15;
// return
return args;
} // you forgot this closing
});
</script>
<?php
}
add_action('acf/input/admin_footer', 'acf_timepicker_input_admin_footer');
I hope this helps 🙂
This is a really perfect for a new blogger like me who doesn’t want their site to be messy with those spammers who don’t even read your post but they have the guts to comment in your site. Thanks again.
Speaking of site, take a look at here: chokdeebacarrat
The topic ‘Time Picker Args’ is closed to new replies.
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.