Commit 04d86da
committed
deps,test: restore month name in DateTimeFormat with calendar=iso8601
`Intl.DateTimeFormat` with `calendar: 'iso8601'` (or via the
`-u-ca-iso8601` locale extension) silently dropped the month part of
the formatted output for `dateStyle` `'medium'`/`'long'`/`'full'` and
for any explicit `month` option, leaving e.g.
new Intl.DateTimeFormat('en-US', {
dateStyle: 'full', timeStyle: 'long',
timeZone: 'UTC', calendar: 'iso8601',
}).format(new Date('2024-09-09T08:00:00Z'))
producing `"2024 9, Monday at 08:00:00 AM UTC"` instead of
`"2024 September 9, Monday at 08:00:00 AM UTC"`.
The ICU `iso8601` calendar resource bundle is intentionally empty: per
Unicode TR35 the iso8601 calendar is gregorian with ISO week-numbering
and therefore inherits gregorian symbols. ICU does not currently
provide month-name fallback for that calendar, so MMMM/MMM expansions
resolve to empty strings during pattern construction.
Use a copy of the ICU locale with `ca=gregory` for the pattern
generator and SimpleDateFormat construction. The iso8601 Calendar
instance is still produced from the original locale and attached via
`adoptCalendar`, so `resolvedOptions().calendar` continues to report
`"iso8601"` and ISO week-numbering semantics are preserved.
Refs: #63041
https://claude.ai/code/session_016L6yWKzfkf5JhyDzK5S6sC1 parent bbf51ad commit 04d86da
2 files changed
Lines changed: 120 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2695 | 2695 | | |
2696 | 2696 | | |
2697 | 2697 | | |
| 2698 | + | |
| 2699 | + | |
| 2700 | + | |
| 2701 | + | |
| 2702 | + | |
| 2703 | + | |
| 2704 | + | |
| 2705 | + | |
| 2706 | + | |
| 2707 | + | |
| 2708 | + | |
| 2709 | + | |
| 2710 | + | |
| 2711 | + | |
| 2712 | + | |
| 2713 | + | |
| 2714 | + | |
| 2715 | + | |
| 2716 | + | |
| 2717 | + | |
| 2718 | + | |
| 2719 | + | |
| 2720 | + | |
2698 | 2721 | | |
2699 | 2722 | | |
2700 | 2723 | | |
2701 | 2724 | | |
2702 | | - | |
| 2725 | + | |
| 2726 | + | |
2703 | 2727 | | |
2704 | 2728 | | |
2705 | 2729 | | |
| |||
2926 | 2950 | | |
2927 | 2951 | | |
2928 | 2952 | | |
2929 | | - | |
| 2953 | + | |
2930 | 2954 | | |
2931 | 2955 | | |
2932 | 2956 | | |
| |||
3002 | 3026 | | |
3003 | 3027 | | |
3004 | 3028 | | |
3005 | | - | |
3006 | | - | |
| 3029 | + | |
| 3030 | + | |
| 3031 | + | |
| 3032 | + | |
3007 | 3033 | | |
3008 | 3034 | | |
3009 | | - | |
3010 | | - | |
3011 | | - | |
| 3035 | + | |
| 3036 | + | |
| 3037 | + | |
| 3038 | + | |
| 3039 | + | |
| 3040 | + | |
3012 | 3041 | | |
3013 | 3042 | | |
3014 | 3043 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
0 commit comments