support calendar display type (Gregorian and Buddhist)

This commit is contained in:
MaysWind
2025-08-28 00:31:59 +08:00
parent c099443783
commit 411130db4e
47 changed files with 769 additions and 788 deletions
+11 -5
View File
@@ -4,18 +4,19 @@ import type { NumeralSystem } from '@/core/numeral.ts';
export interface DateTime {
getUnixTime(): number;
getLocalizedCalendarYear(options: DateTimeFormatOptions): number;
getLocalizedCalendarYear(options: DateTimeFormatOptions): string;
getGregorianCalendarYear(): number;
getGregorianCalendarQuarter(): number;
getLocalizedCalendarQuarter(options: DateTimeFormatOptions): number;
getGregorianCalendarMonth(): number;
getGregorianCalendarMonthDisplayName(options: DateTimeFormatOptions): string;
getGregorianCalendarMonthDisplayShortName(options: DateTimeFormatOptions): string;
getLocalizedCalendarMonth(options: DateTimeFormatOptions): number;
getLocalizedCalendarMonth(options: DateTimeFormatOptions): string;
getLocalizedCalendarMonthIndex(options: DateTimeFormatOptions): number;
getLocalizedCalendarMonthDisplayName(options: DateTimeFormatOptions): string;
getLocalizedCalendarMonthDisplayShortName(options: DateTimeFormatOptions): string;
getGregorianCalendarDay(): number;
getLocalizedCalendarDay(options: DateTimeFormatOptions): number;
getLocalizedCalendarDay(options: DateTimeFormatOptions): string;
getGregorianCalendarYearDashMonthDashDay(): TextualYearMonthDay;
getGregorianCalendarYearDashMonth(): TextualYearMonth;
getWeekDay(): WeekDay;
@@ -33,8 +34,8 @@ export interface DateTime {
}
export interface DateTimeFormatOptions {
calendarType: CalendarType;
numeralSystem: NumeralSystem;
calendarType: CalendarType;
localeData: DateTimeLocaleData;
}
@@ -70,12 +71,17 @@ export interface YearMonthRange {
readonly endYearMonth: Year0BasedMonth;
}
export interface YearMonthDay {
export interface YearMonthDay extends MonthDay {
readonly year: number;
readonly month: number; // 1-based (1 = January, 12 = December)
readonly day: number;
}
export interface MonthDay {
readonly month: number; // 1-based (1 = January, 12 = December
readonly day: number;
}
export interface TimeRange {
readonly minTime: number;
readonly maxTime: number;