Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #1187875

    Hello,

    My datepicker on my contact form is reversing mm/dd/yy to display as dd/mm/yy, even though in the heading it says mm/dd/yy. How do I fix this?

    Thanks,
    Ryan

    #1188145

    Hey ryanmeighan,

    Please have a look at the following thread:
    https://kriesi.at/support/topic/mm-dd-yy-order-in-datepicker/

    If you need further assistance please let us know.

    Best regards,
    Victoria

    #1188201

    Hi Victoria,

    I tried both codes on that thread and it didn’t work. i went to Appearance > Theme Editor > Theme Functions (functions.php)
    and copy-pasted the following code to the bottom:

    add_filter( ‘avf_datepicker_dateformat’, function(){ return ‘mm / dd / yy’; } );
    add_filter( ‘avf_datepicker_date_placeholder’, function(){ return ‘MM / DD / YY’; } );

    i received an error message. Then i tried deleting that block of code and updating the file but it gave me another error message.

    • This reply was modified 4 weeks ago by Yigit.
    #1188234

    try it this way:
    and copy paste please – if participants don’t use the code tag it is hard to inspect if you are using correct Quotationmarks

    add_filter('avf_datepicker_dateformat', 'new_date_format');
    function new_date_format() {
    $date_format = "mm / dd / yy";
    return $date_format;
    }
    
    add_filter('avf_datepicker_date_placeholder', 'new_date_placeholder');
    function new_date_placeholder() {
    $placeholder = "MM / DD / YY";
    return $placeholder;
    }
    #1188261

    well, i received another error message, but when testing my site that fixed it. Thanks!

    #1188757

    Hi Ryan,

    Thanks for the update, so everything is working as it should now then?

    Best regards,
    Rikard

    #1189480

    yes it did, thank you!

    #1189626

    Hi,

    Great, thanks for the update. Please let us know if you should need any further help on the topic or if we can close it.

    Best regards,
    Rikard

    #1203642

    Hello,

    That code block i added to functions went away and my site switched back to dd/mm/yy (i want mm/dd/yy). I tried re-adding the same block of code Guenni007 gave me and received the error:

    “Unable to communicate back with site to check for fatal errors, so the PHP change was reverted. You will need to upload your PHP file change by some other means, such as by using SFTP.”

    *after receiving this error i checked my site and the preview text now shows mm/dd/yy, but after selecting the date it goes back to dd/mm/yy

    thanks,
    Ryan

    #1204747

    just following up on this.

    Thanks,
    Ryan

    #1208517

    Hi,

    Please try adding the code via FTP. You can find functions.php file inside /wp-content/themes/enfold/ folder and add the code to the bottom of the file

    add_filter('avf_datepicker_dateformat', 'new_date_format');
    function new_date_format() {
    $date_format = "mm / dd / yy";
    return $date_format;
    }
    
    add_filter('avf_datepicker_date_placeholder', 'new_date_placeholder');
    function new_date_placeholder() {
    $placeholder = "MM / DD / YY";
    return $placeholder;
    }

    File would be overwritten in each update so please consider using a child theme – https://kriesi.at/documentation/enfold/child-theme/ and add the code to functions.php file of child theme instead.

    Best regards,
    Yigit

    #1208548
    This reply has been marked as private.
Viewing 12 posts - 1 through 12 (of 12 total)
  • The topic ‘Datepicker flip flopping month and day’ is closed to new replies.