@marchingy/lunar
Version:
Chinese calendar with the 24 solar terms.
51 lines (50 loc) • 1.7 kB
TypeScript
export declare const TIME_ZONE_OFFSET: number;
export declare const CHINESE_OFFSET: number;
export declare function countDaysOnYear(year: number): number;
export declare function isNewMoon(date: Date): boolean;
export declare function countNewMoons(fromDate: Date, toDate: Date): Array<Date>;
export declare function getWinterSolstice(year: number): Date;
export declare function getWinterSolsticeRange(date: Date): Array<Date>;
export declare function isMissingMidTermMonth(date: Date): boolean;
export declare function isLeapMonth(date: Date): boolean;
export interface OLunarYear {
readonly sexagesimal: () => string;
readonly zodiac: () => string;
readonly toString: () => string;
readonly valueOf: () => number;
}
export interface OLunarMonth {
readonly capital: () => string;
readonly isLeap: () => boolean;
readonly sexagesimal: () => string;
readonly toString: () => string;
readonly valueOf: () => number;
}
export interface OLunarDay {
readonly capital: () => string;
readonly sexagesimal: () => string;
readonly toString: () => string;
readonly valueOf: () => number;
}
/**
* @description 8h = 28800000ms, minus 8 hours to get china time zone date.
*/
export declare class ChineseDate extends Date {
/**
*
* @returns A new instance of LunarYear.
*/
getLunarYear(): OLunarYear;
/**
* @description A lunar month is 11 if winter solstice is in this month.
* @returns A new instance of LunarMonth.
*/
getLunarMonth(): OLunarMonth;
/**
*
* @returns A new instance of LunarDay.
*/
getLunarDay(): OLunarDay;
toChineseString(): string;
toLunarString(): string;
}