0

The default Magento date-picker format for birth-date on create account page is mm/dd/yyyy. how can i change it into dd/mm/yyyy format in Magento 2.3

2

Datepicker format is via customizations of the widget of the datepicker from jQuery UI. Check the DOB template and see how that's being triggered, if I am not wrong, they hardcode it via PHP block rendering. If I were you, I'll override the template and create a newer input field with the new call to the javascript widget so you can actually customize it.

Here: https://devdocs.magento.com/guides/v2.3/javascript-dev-guide/widgets/widget_calendar.html

For more information about the base of it: https://api.jqueryui.com/datepicker/

You have the parameters to set it. If you check here you will see the whole specs of the custom Magento widget: https://github.com/magento/magento2/blob/2.3/lib/web/mage/calendar.js

PS. I personally bring a third-party datepicker library because I don't like the basics from jQuery UI. This is my favorite: http://www.daterangepicker.com/

| improve this answer | |
  • Do you the default magento block where the date format is set? i can overirde it – Nafsss Aug 28 '19 at 4:49
  • @Nafisa you should not override it. You should extend it if you need or call another library from a third-party repo and include it on your theme. Check how widgets are being developed on the Magento core UI. Follow the dev docs for good practice. devdocs.magento.com/guides/v2.3/javascript-dev-guide/widgets/… – Ezequiel Alba Aug 28 '19 at 18:48
0

Magestore has provided the solution

https://www.magestore.com/magento-2-tutorial/set-date-format-in-magento-2-by-your-own/

| improve this answer | |
  • No, this does not help – Nafsss Aug 26 '19 at 12:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.