How can I change the dateformat for calendar inputs?

Help for integrating the Laravel package
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
shainanand
Posts: 26
Joined: 16 Oct 2023, 15:05

How can I change the dateformat for calendar inputs?

Post by shainanand » 23 Jan 2024, 14:14

Currently, the input dates are having the format YYYY-MM-DD. I would like to change it to MM-DD-YYYY. What is the best way to do this?

User avatar
aimeos
Administrator
Posts: 7895
Joined: 01 Jan 1970, 00:00

Re: How can I change the dateformat for calendar inputs?

Post by aimeos » 24 Jan 2024, 09:13

For the admin backend, you can overwrite the Flatpickr configuration in the themes/admin/custom.js file of your own extension:
https://github.com/aimeos/ai-admin-jqad ... in.js#L105

Code: Select all

Aimeos.flatpickr.date.altFormat = 'M j, Y';
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

shainanand
Posts: 26
Joined: 16 Oct 2023, 15:05

Re: How can I change the dateformat for calendar inputs?

Post by shainanand » 24 Jan 2024, 14:29

Thanks for the response. I came across this js file while debugging but I could not find a way to overwrite the file as this file is in vendor folder in Laravel. Could you please help to suggest the best way to overwrite this file/js code?

User avatar
aimeos
Administrator
Posts: 7895
Joined: 01 Jan 1970, 00:00

Re: How can I change the dateformat for calendar inputs?

Post by aimeos » 24 Jan 2024, 14:36

In ./packages/<yourextension>/themes/admin/custom.js
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply