Tagged: CONTACT FORM, datepicker
-
AuthorPosts
-
February 25, 2020 at 10:35 pm #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,
RyanFebruary 26, 2020 at 6:17 pm #1188145Hey 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,
VictoriaFebruary 26, 2020 at 7:23 pm #1188201Hi 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 1 month, 4 weeks ago by Yigit.
February 26, 2020 at 8:24 pm #1188234try 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 Quotationmarksadd_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; }
February 26, 2020 at 9:03 pm #1188261well, i received another error message, but when testing my site that fixed it. Thanks!
February 28, 2020 at 6:47 am #1188757Hi Ryan,
Thanks for the update, so everything is working as it should now then?
Best regards,
RikardMarch 2, 2020 at 5:10 pm #1189480yes it did, thank you!
March 3, 2020 at 9:00 am #1189626Hi,
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,
RikardApril 14, 2020 at 4:07 pm #1203642Hello,
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,
RyanApril 17, 2020 at 4:40 pm #1204747just following up on this.
Thanks,
RyanApril 30, 2020 at 2:30 pm #1208517Hi,
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,
YigitApril 30, 2020 at 5:03 pm #1208548This reply has been marked as private. -
AuthorPosts
- The topic ‘Datepicker flip flopping month and day’ is closed to new replies.