mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-15 23:47:33 +08:00
calendar display type supports Gregorian with Chinese
This commit is contained in:
+11
-1
@@ -2,7 +2,16 @@ import type { TypeAndName } from '@/core/base.ts';
|
||||
|
||||
export enum CalendarType {
|
||||
Gregorian = 0,
|
||||
Buddhist = 1
|
||||
Buddhist = 1,
|
||||
Chinese = 2
|
||||
}
|
||||
|
||||
export interface ChineseCalendarLocaleData {
|
||||
readonly numerals: string[];
|
||||
readonly monthNames: string[];
|
||||
readonly dayNames: string[];
|
||||
readonly leapMonthPrefix: string;
|
||||
readonly solarTermNames: string[];
|
||||
}
|
||||
|
||||
export class CalendarDisplayType implements TypeAndName {
|
||||
@@ -13,6 +22,7 @@ export class CalendarDisplayType implements TypeAndName {
|
||||
public static readonly LanguageDefaultType: number = 0;
|
||||
public static readonly Gregorian = new CalendarDisplayType(1, 'Gregorian', 'Gregorian', CalendarType.Gregorian);
|
||||
public static readonly Buddhist = new CalendarDisplayType(2, 'Buddhist', 'Buddhist', CalendarType.Buddhist);
|
||||
public static readonly GregorianWithChinese = new CalendarDisplayType(3, 'GregorianWithChinese', 'Gregorian with Chinese', CalendarType.Gregorian, CalendarType.Chinese);
|
||||
|
||||
public static readonly Default = CalendarDisplayType.Gregorian;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { TypeAndName, TypeAndDisplayName } from '@/core/base.ts';
|
||||
import type { CalendarType } from '@/core/calendar.ts';
|
||||
import type { CalendarType, ChineseCalendarLocaleData } from '@/core/calendar.ts';
|
||||
import type { NumeralSystem } from '@/core/numeral.ts';
|
||||
|
||||
export interface DateTime {
|
||||
@@ -12,7 +12,6 @@ export interface DateTime {
|
||||
getGregorianCalendarMonthDisplayName(options: DateTimeFormatOptions): string;
|
||||
getGregorianCalendarMonthDisplayShortName(options: DateTimeFormatOptions): string;
|
||||
getLocalizedCalendarMonth(options: DateTimeFormatOptions): string;
|
||||
getLocalizedCalendarMonthIndex(options: DateTimeFormatOptions): number;
|
||||
getLocalizedCalendarMonthDisplayName(options: DateTimeFormatOptions): string;
|
||||
getLocalizedCalendarMonthDisplayShortName(options: DateTimeFormatOptions): string;
|
||||
getGregorianCalendarDay(): number;
|
||||
@@ -37,6 +36,7 @@ export interface DateTimeFormatOptions {
|
||||
numeralSystem: NumeralSystem;
|
||||
calendarType: CalendarType;
|
||||
localeData: DateTimeLocaleData;
|
||||
chineseCalendarLocaleData: ChineseCalendarLocaleData;
|
||||
}
|
||||
|
||||
export interface DateTimeLocaleData {
|
||||
@@ -82,6 +82,10 @@ export interface MonthDay {
|
||||
readonly day: number;
|
||||
}
|
||||
|
||||
export interface CalendarAlternateDate extends YearMonthDay {
|
||||
readonly displayDate: string;
|
||||
}
|
||||
|
||||
export interface TimeRange {
|
||||
readonly minTime: number;
|
||||
readonly maxTime: number;
|
||||
|
||||
Reference in New Issue
Block a user