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
1 Answer 1
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/
-
Do you the default magento block where the date format is set? i can overirde itNafsss– Nafsss2019年08月28日 04:49:22 +00:00Commented Aug 28, 2019 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– Ezequiel Alba2019年08月28日 18:48:10 +00:00Commented Aug 28, 2019 at 18:48