Rewrite dateTime.js to use current localeData#378
Conversation
| 'AZT': '+0400', | ||
| 'B': '+0200', | ||
| 'BDST': '+0100', | ||
| 'BDST': '+0200', |
There was a problem hiding this comment.
These were just mistakes you noticed?
There was a problem hiding this comment.
"Mistakes" AI noticed, but I don't trust it understands the context. I'll make a story to review these, but will revert these from this PR.
| return convertJsDateToLocalDateTime(utcDate) || date; | ||
| } | ||
|
|
||
| function convertCldrDatePattern(pattern, forceFullYear) { |
There was a problem hiding this comment.
Maybe some unit tests for this guy?
| 'short': convertCldrDatePattern(localeData.dateFormatItems.yMd, true), | ||
| 'monthYear': convertCldrDatePattern(localeData.dateFormatItems.yMMMM, false), | ||
| 'monthDay': convertCldrDatePattern(localeData.dateFormatItems.MMMMd, false), | ||
| 'shortMonthDay': convertCldrDatePattern(localeData.dateFormatItems.MMMd, false), |
There was a problem hiding this comment.
This stuff ends up all being static eh? Wonder if it'd be useful doing these calculations at build-time instead of runtime and storing them in locale-data.js?
There was a problem hiding this comment.
I'll look at this, but it's cached after the first run. I do want to avoid storing converted data in locale-data/ so we just have a clean source of truth. A lot of this may go away very soon too with the skeleton work coming up, so we can look at it again then.
| let weekendStartDay = 6; | ||
| let weekendEndDay = 0; | ||
|
|
||
| switch (baseLanguage) { |
There was a problem hiding this comment.
Nice! The fact that all the unit tests passed seems to indicate that the CLDR data was a match for what we were doing here?
There was a problem hiding this comment.
If only. I had a bad import reference so basically none of the ones that matter ran.
fc0bc46 to
b46a9c9
Compare
2490e5a to
be95d77
Compare
be95d77 to
22568a3
Compare
6b3fda0 to
7a5b68a
Compare
7a5b68a to
164c714
Compare
GAUD-9717: Rewrite intl/common and intl/dateTime to use contained data sets per locale
Run #1
locale-data/644 failed tests
Run #2
documentLocaleSettingsresetmethod so it runs listeners when it "resets" (changes) the language back to English. This is only used in tests.locale-data/to match the CLDR source names and update how the files are matched for loading304 failed tests
Run #3
242 failed tests
Run #4
LLLL- Stand-alone month in year (e.g. Catalan:MMMM-> "d'abril",LLLL-> "abril")cccc- Stand-alone day of weekK- Hour in day, 12 hour, 0-11 (e.g. "0:29 pm")225 failed tests