-
AuthorPosts
-
January 28, 2014 at 3:16 am #215609
Looking for a way to change the date format from DD / MM / YY to MM / DD / YY.
I found it in framework > php > class-form-generator.php
I changed it there (lines 260-61), and placed the file in the same structure in my child theme, but it doesn’t take.
Any suggestions? Can this be changed via setting in the database?
January 28, 2014 at 6:46 pm #215961Hey hughjames!
Just to make sure, please go to wp-content\themes\enfold\framework\php folder and open class-form-generator.php file and find
$date_format = apply_filters('avf_datepicker_dateformat', 'dd / mm / yy'); $placeholder = apply_filters('avf_datepicker_date_placeholder', 'DD / MM / YY');and change it to
$date_format = apply_filters('avf_datepicker_dateformat', 'mm / dd / yy'); $placeholder = apply_filters('avf_datepicker_date_placeholder', 'MM / DD / YY');It does work fine on my installation
Best regards,
YigitJanuary 28, 2014 at 10:35 pm #216073This is so strange. I put it in the child theme (structured the same) and it ignores it. Am I doing something wrong?
I am hesitant to overwrite the original theme files, as they’ll be overwritten in updates.
-Hugh
January 29, 2014 at 12:13 am #216100Hey!
Please add this on the child theme’s function.php:
add_filter('avf_datepicker_dateformat', 'avf_change_datepicker_format'); function avf_change_datepicker_format($date_format) { $date_format = 'mm / dd / yy'; return $date_format; } add_filter('avf_datepicker_date_placeholder', 'avf_change_datepicker_date_placeholder'); function avf_change_datepicker_date_placeholder($placeholder) { $placeholder = 'MM / DD / YY'; return $placeholder; }Regards,
IsmaelJanuary 29, 2014 at 12:24 am #216113Thanks. That worked!
So if I need to make changes in the child theme, do I need to do it this way? The standard method of just putting the files that override doesn’t seem to work, other than the functions.php and style.css.
-
AuthorPosts
- The topic ‘Datepicker Format for Forms’ is closed to new replies.
