olton / Metro-UI-CSS

Impressive component library for expressive web development! Build responsive projects on the web with the first front-end component library in Metro Style. And now there are even more opportunities every day!
http://metroui.org.ua/
MIT License
7k stars 1.97k forks source link

Date format in Calendarpicker not working #1884

Open bogozaur opened 1 year ago

bogozaur commented 1 year ago

Describe the bug In the latest build, when you change the output date format from the default YYYY-mm-dd to anything else, the result is not correctly formatted.

To Reproduce Create a input with data-role="calendarpicker", set data-format="%d %b %Y" or data-format="%d %B %Y" . Now when you pick a date from the calendar, the result is %3 %b %undefined or %2 %B %undefined. The same problem can be seen in the example here: https://metroui.org.ua/calendarpicker.html

Expected behavior The date should be formatted correctly using the data-format format.

Screenshots image image

olton commented 1 year ago

https://github.com/olton/datetime/blob/master/src/core/class.js#L236

olton commented 1 year ago

Thank you, I will investigate this bug.