Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
655 views
Welcome To Ask or Share your Answers For Others

1 Answer

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.)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...