pods-framework / pods

The Pods Framework is a Content Development Framework for WordPress - It lets you create and extend content types that can be used for any project. Add fields of various types we've built in, or add your own with custom inputs, you have total control.
https://pods.io/
GNU General Public License v2.0
1.07k stars 264 forks source link

MomentJS isn't properly loading locales #6974

Open JoryHogeveen opened 1 year ago

JoryHogeveen commented 1 year ago

Description

MomentJS isn't properly loading locales as found online (or on node). It should also translate the week days and change the start of the week, however, only the months are translated

Version

2.9.10

Testing Instructions

  1. Add date field
  2. Set locale to NL / DE or any other EU language
  3. See months translated
  4. See week names and start of the week day unchanged :(
sc0ttkclark commented 1 year ago

@zrothauser Passing this one onto you. I did some work here (https://github.com/pods-framework/pods/commit/6e0c762bab617a6a88c66c3bce36503f8cf2753e) but it's not enough. I don't know what we can do to get MomentJS / react-datetime on board with the locale. Everything else looks translated including custom date formats in the input text but the calendars just always end up with Su, Mo, Tu, We, Th, Fr, Sa.

Screen Shot 2023-02-19 at 10 10 01 PM
sc0ttkclark commented 1 year ago

The demo here seems to show that it's possible, so something must be going wrong in our implementation, perhaps because we are passing in a moment object for the current value?

https://codesandbox.io/s/heuristic-ully-2duehb?file=/src/App.js