/** * @fileoverview Non-Gregorian calendar conversions using Intl.DateTimeFormat * Supports Hebrew, Islamic, Buddhist, Japanese, Persian, and Chinese calendars */ export interface CalendarDate { year: number; month: number; day: number; era?: string; calendar: string; } export interface HebrewDate extends CalendarDate { calendar: 'hebrew'; } export interface IslamicDate extends CalendarDate { calendar: 'islamic' | 'islamic-umalqura' | 'islamic-civil'; } export interface BuddhistDate extends CalendarDate { calendar: 'buddhist'; } export interface JapaneseDate extends CalendarDate { calendar: 'japanese'; era: string; } export interface PersianDate extends CalendarDate { calendar: 'persian'; } export interface ChineseDate extends CalendarDate { calendar: 'chinese'; cycleYear?: number; } export type CalendarType = 'hebrew' | 'islamic' | 'islamic-umalqura' | 'islamic-civil' | 'buddhist' | 'japanese' | 'persian' | 'chinese'; /** * Convert Gregorian date to Hebrew calendar * @example toHebrewDate(new Date('2024-03-25')) // { year: 5784, month: 6, day: 15, calendar: 'hebrew' } */ export declare function toHebrewDate(date: Date): HebrewDate; /** * Convert Gregorian date to Islamic calendar (default: islamic-umalqura) * @param date - Date to convert * @param variant - Islamic calendar variant: 'islamic', 'islamic-umalqura', 'islamic-civil' * @example toIslamicDate(new Date('2024-03-25')) // { year: 1445, month: 9, day: 15, calendar: 'islamic-umalqura' } */ export declare function toIslamicDate(date: Date, variant?: 'islamic' | 'islamic-umalqura' | 'islamic-civil'): IslamicDate; /** * Convert Gregorian date to Buddhist calendar (Thai Solar) * Buddhist Era = Gregorian Year + 543 * @example toBuddhistDate(new Date('2024-03-25')) // { year: 2567, month: 3, day: 25, calendar: 'buddhist' } */ export declare function toBuddhistDate(date: Date): BuddhistDate; /** * Convert Gregorian date to Japanese calendar with era * @example toJapaneseDate(new Date('2024-03-25')) // { year: 6, month: 3, day: 25, era: 'Reiwa', calendar: 'japanese' } */ export declare function toJapaneseDate(date: Date): JapaneseDate; /** * Convert Gregorian date to Persian (Jalali/Solar Hijri) calendar * @example toPersianDate(new Date('2024-03-20')) // { year: 1403, month: 1, day: 1, calendar: 'persian' } */ export declare function toPersianDate(date: Date): PersianDate; /** * Convert Gregorian date to Chinese lunar calendar * @example toChineseDate(new Date('2024-02-10')) // { year: 4721, month: 1, day: 1, calendar: 'chinese' } */ export declare function toChineseDate(date: Date): ChineseDate; /** * Format date in specified calendar system * @param date - Date to format * @param calendar - Calendar system to use * @param locale - Locale for formatting (default: 'en') * @param options - Additional Intl.DateTimeFormat options */ export declare function formatInCalendar(date: Date, calendar: CalendarType, locale?: string, options?: Intl.DateTimeFormatOptions): string; /** * Get month names for a specific calendar system * @param calendar - Calendar system * @param locale - Locale for month names (default: 'en') * @param format - Month name format: 'long', 'short', 'narrow' */ export declare function getCalendarMonthNames(calendar: CalendarType, locale?: string, format?: 'long' | 'short' | 'narrow'): string[]; /** * Get era name for Japanese calendar * @param date - Date to get era for * @param format - Era format: 'long', 'short', 'narrow' */ export declare function getJapaneseEra(date: Date, format?: 'long' | 'short' | 'narrow'): string; /** * Get all Japanese era names with their start dates */ export declare function getJapaneseEras(): Array<{ name: string; start: Date; }>; /** * Check if a Hebrew year is a leap year (has 13 months) * @param hebrewYear - Year in Hebrew calendar */ export declare function isHebrewLeapYear(hebrewYear: number): boolean; /** * Get Hebrew month name * @param month - Month number (1-13) * @param isLeapYear - Whether the year is a leap year */ export declare function getHebrewMonthName(month: number, isLeapYear?: boolean): string; /** * Get Islamic month name * @param month - Month number (1-12) */ export declare function getIslamicMonthName(month: number): string; /** * Get Persian month name * @param month - Month number (1-12) */ export declare function getPersianMonthName(month: number): string; /** * Check if a Persian year is a leap year * Uses the 2820-year cycle algorithm */ export declare function isPersianLeapYear(persianYear: number): boolean; /** * Get Chinese zodiac animal for a year * @param gregorianYear - Gregorian year */ export declare function getChineseZodiac(gregorianYear: number): string; /** * Get Chinese element for a year * @param gregorianYear - Gregorian year */ export declare function getChineseElement(gregorianYear: number): string; /** * Get full Chinese zodiac description (element + animal) * @param gregorianYear - Gregorian year */ export declare function getChineseZodiacFull(gregorianYear: number): string; /** * Convert calendar date to string representation */ export declare function calendarDateToString(calendarDate: CalendarDate): string; /** * Compare two calendar dates * @returns negative if a < b, 0 if equal, positive if a > b */ export declare function compareCalendarDates(a: CalendarDate, b: CalendarDate): number; /** * Get current date in specified calendar */ export declare function today(calendar: CalendarType): CalendarDate; /** * Check if two calendar dates are the same day */ export declare function isSameCalendarDay(a: CalendarDate, b: CalendarDate): boolean; /** * Get supported calendar systems */ export declare function getSupportedCalendars(): CalendarType[]; //# sourceMappingURL=calendars.d.ts.map