Please help with basic date picker customization
-
For date picker on all my forms, I need dd-mm-yy instead of default mm-dd-yy
Cannot get it to change, alhough I tried to follow these instructions:
https://vfbpro.com/2012/02/23/how-to-customize-the-date-picker/I’m not familiar with how this works. I’ve been struggling a long time, unable to get the date format to change. Wrong date format is a big problem for my form users. I will be VERY grateful for help!
Code below for new file functions.php that I uploaded to child theme, and new file my-js2.js in sub-folder js
<?php function my_scripts_method() { wp_register_script( 'my-js-file', get_template_directory_uri() . '/js/my-js2.js', array( 'jquery' ), '1.0', false ); wp_enqueue_script( 'my-js-file' ); } add_action( 'wp_enqueue_scripts', 'my_scripts_method' ); ?>
This is my js file:
jQuery(document).ready(function($) { $.datepicker.setDefaults({ dateFormat: 'dd-mm-yy' }); });
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Please help with basic date picker customization’ is closed to new replies.