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?
Hey 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,
Yigit
This 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
Hey!
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,
Ismael
Thanks. 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.