Is it possible to change the order of the Date / Time Field?
I have it set on Date, under type selection but I do not like that it does YYYY-MM-DD
I would rather it be MM-DD-YYYY. Since this varies among users, I am willing to modify my own PHP file if you are can help me locate where I would make this change.
I have WordPress setup to use MM-DD-YYYY format so I would like consistency across all my pages.
In order to change date format you need to edit two files.
Please follow those steps:
1. Open user-meta/views/generateForm.php by text editor (through ftp client)
2. Scroll down to buttom, Find those two lines:
$(“.um_datetime”).datetimepicker({ dateFormat: ‘yy-mm-dd’, timeFormat: ‘hh:mm:ss’ });
$(“.um_date”).datepicker({ dateFormat: ‘yy-mm-dd’ });
change ‘yy-mm-dd’ to ‘mm-dd-yy’
3. Save changes.
4. Open user-meta/assets/js/jquery/validationEngine-en.js
5. find “date” section (line number 72 in version 1.1.1),
remove or comments:
“regex”: /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/,
add:
“regex”: /^(0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])[\/\-]\d{4}$/,
6. find “datetime” section (line number 82 in version 1.1.1),
remove or comments:
“regex”: /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])\s?([01][0-9]|[2][0-4]):[0-6][0-9]:[0-6][0-9]\s?$/,
Add:
“regex”: /^(0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])[\/\-]\d{4}\s?([01][0-9]|[2][0-4]):[0-6][0-9]:[0-6][0-9]\s?$/,
7. Save changes.
Keep in mind, you should keep backup your updated file before user-meta version update. unless, those file will be overwrite with new version files.
In order to not receive error Java verification field I change it in:
assets\js\user-meta.js
from
jQuery(“.um_date”).datepicker({ dateFormat: ‘yy-mm-dd’, changeYear: true });
to
jQuery(“.um_date”).datepicker({ dateFormat: ‘dd-mm-yy’, changeYear: true });
I need change lang of datapicker, names of days, months. By default I get the calendar in English and I need it in Spanish (I have the wordpress language in Spanish)
Unfortunately, User Meta does not have the language selecting feature specifically in date-picker yet.
However, upon your request, we will consider adding this option in future updates.
Thanks!
Author
Posts
Viewing 7 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic.
This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish.AcceptRead More
Privacy & Cookies Policy
Privacy Overview
This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.