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
7.02k stars 1.97k forks source link

Calendar locale #1376

Closed arjarn closed 5 years ago

arjarn commented 5 years ago

I'm using calendar picker like this :

<input id="mdatedeb" data-role="calendarpicker" 
                 data-input-format="dd/mm/yyyy" value="25/10/2019"
                 data-format="%d %B %Y" />

and adding in header.

When my page is displaying, date are in US mode but if I display calendar, it's french mode (if I choose another date, date is in french mode too).

Perhaps I'm missing something ?

olton commented 5 years ago

check data-locale attribute, meta:locale meta tag ?

arjarn commented 5 years ago

I've :

<meta name="metro4:locale" content="fr-FR">

olton commented 5 years ago

By default, calendar picker use METRO_LOCALE global var, This variable init from meta tag metro4:locale. Use data-locale="en-US" attribute for calendar picker to set to en-US

arjarn commented 5 years ago

In fact, I want FR calendar, it's why I'm using metro4:locale with fr-FR value. But when my page is displaying (with default values set for calendar), calendar format is en-US

My draft page : https://sandbox.org.ua/arjarn/code/azbM3YfemW

See first date : "May" is showing, if you click on calendar "Mai" (in french)

olton commented 5 years ago

I see: initial value in US, after select date - in FR. Ok, I check it.

olton commented 5 years ago

I fix it. Thanks