(fmt: DateFormat)
| 22 | } as const; |
| 23 | |
| 24 | function segmentsFor(fmt: DateFormat): SegmentConfig[] { |
| 25 | return [...fmt].map((c) => SEGMENTS[c as keyof typeof SEGMENTS]); |
| 26 | } |
| 27 | |
| 28 | function detectLocaleFormat(locale?: string): { segments: SegmentConfig[]; separator: string } { |
| 29 | const fmt = new Intl.DateTimeFormat(locale, { |