Skip to content

DateTimeFormat: add support for more than two dayPeriod : CLDR's "B" and "b" #343

@jungshik

Description

@jungshik

In some locales, they have more than two day periods (AM/PM).

CLDR has data for flexible day periods (B) and 'am, pm, noon, midnight' (b) in addition to "AM/PM" (a). https://www.unicode.org/reports/tr35/tr35-dates.html#dfst-period .

For instance, Chinese (zh) locale data has the following, but there is no way to format time with 'B' or 'b'.

{{{
dayPeriod{
format{
abbreviated{
afternoon1{"中午"}
afternoon2{"下午"}
evening1{"晚上"}
midnight{"午夜"}
morning1{"早上"}
morning2{"上午"}
night1{"凌晨"}
}

....

        availableFormats{
            Bh{"Bh时"}
            Bhm{"Bh:mm"}
            Bhms{"Bh:mm:ss"}
            E{"ccc"}
            EBhm{"EB h:mm"}
            EBhms{"EB h:mm:ss"}

}}}

Metadata

Metadata

Assignees

Labels

c: datetimeComponent: dates, times, timezoness: in progressStatus: the issue has an active proposal

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions