1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 15:48:12 +00:00

LibUnicode: Parse and generate date time range format patterns

This commit is contained in:
Timothy Flynn 2021-12-08 17:07:30 -05:00 committed by Linus Groh
parent fe84a365c2
commit 9d4c4303fd
3 changed files with 411 additions and 46 deletions

View file

@ -118,6 +118,26 @@ struct CalendarPattern {
Optional<CalendarPatternStyle> time_zone_name {};
};
struct CalendarRangePattern : public CalendarPattern {
enum class Field {
Era,
Year,
Month,
Day,
AmPm,
DayPeriod,
Hour,
Minute,
Second,
FractionalSecondDigits,
};
Optional<Field> field {};
String start_range {};
StringView separator {};
String end_range {};
};
enum class CalendarFormatType : u8 {
Date,
Time,
@ -139,6 +159,9 @@ Vector<Unicode::HourCycle> get_regional_hour_cycles(StringView locale);
Optional<Unicode::HourCycle> get_default_regional_hour_cycle(StringView locale);
Optional<CalendarFormat> get_calendar_format(StringView locale, StringView calendar, CalendarFormatType type);
Vector<CalendarPattern> get_calendar_available_formats(StringView locale, StringView calendar);
Optional<Unicode::CalendarRangePattern> get_calendar_default_range_format(StringView locale, StringView calendar);
Vector<Unicode::CalendarRangePattern> get_calendar_range_formats(StringView locale, StringView calendar, StringView skeleton);
Vector<Unicode::CalendarRangePattern> get_calendar_range12_formats(StringView locale, StringView calendar, StringView skeleton);
Optional<StringView> get_calendar_era_symbol(StringView locale, StringView calendar, CalendarPatternStyle style, Unicode::Era value);
Optional<StringView> get_calendar_month_symbol(StringView locale, StringView calendar, CalendarPatternStyle style, Unicode::Month value);
Optional<StringView> get_calendar_weekday_symbol(StringView locale, StringView calendar, CalendarPatternStyle style, Unicode::Weekday value);