Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #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?

    http://subterranea.net/vusa2/warranty/

    #215961

    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

    #216073

    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

    #216100

    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

    #216113

    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.

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Datepicker Format for Forms’ is closed to new replies.