FinallyCanuck
FinallyCanuck

Reputation: 13

Localisation for the Netlify CMS UI Date Picker widget?

Is there any way to change to localisation of the Netlify CMS UI so the Date Picker widget is displayed in Monday-Sunday weeks and 24 hour times? I set the locale to ‘en-GB’ on the off-chance that would do it, but no luck.

I'm not looking to change the format of the output, but looking for the UI element to be formatted correctly for my locale. There is a hint to this being possible on the GitHub page, but I can't find how to set the config appropriately.

Upvotes: 0

Views: 163

Answers (1)

Luke Storry
Luke Storry

Reputation: 6732

The sourcecode for the netlify datetime widget shows it uses react-datetime under the hood.

According to those docs, you can pass in a locale there, which is how you'd make monday the day of the week. I would suggest copying the netlify datetime widget (sourcecode here) modifying it to pull in the requirementrs correctly, and then passing in a locale as a prop to the DateTime widget within that.

(Previous answer was incorrect - I thought locales was the solution to this (it normally is with react-datetime), but the netlify locales are only for providing language translations, my bad.)

Upvotes: 0

Related Questions