ts-time-utils
Version:
A comprehensive TypeScript utility library for time, dates, durations, and calendar operations with full tree-shaking support
82 lines • 2.32 kB
TypeScript
/**
* Calendar and holiday utilities
*/
/**
* Get the week number of the year (ISO 8601)
* @param date - date to get week number for
*/
export declare function getWeekNumber(date: Date): number;
/**
* Get the week of the month (1-6)
* @param date - date to get week of month for
*/
export declare function getWeekOfMonth(date: Date): number;
/**
* Get the quarter of the year (1-4)
* @param date - date to get quarter for
*/
export declare function getQuarter(date: Date): number;
/**
* Get the day of the year (1-366)
* @param date - date to get day of year for
*/
export declare function getDayOfYear(date: Date): number;
/**
* Get the number of weeks in a year
* @param year - year to check
*/
export declare function getWeeksInYear(year: number): number;
/**
* Get the number of days in a month
* @param year - year
* @param month - month (0-11)
*/
export declare function getDaysInMonth(year: number, month: number): number;
/**
* Get the number of days in a year
* @param year - year to check
*/
export declare function getDaysInYear(year: number): number;
/**
* Calculate Easter Sunday for a given year (Western/Gregorian calendar)
* @param year - year to calculate Easter for
*/
export declare function getEaster(year: number): Date;
/**
* Get all months in a year
* @param year - year to get months for
*/
export declare function getMonthsInYear(year: number): Date[];
/**
* Get all days in a month
* @param year - year
* @param month - month (0-11)
*/
export declare function getDaysInMonthArray(year: number, month: number): Date[];
/**
* Get all weekdays in a month
* @param year - year
* @param month - month (0-11)
*/
export declare function getWeekdaysInMonth(year: number, month: number): Date[];
/**
* Get the first day of the month
* @param date - any date in the month
*/
export declare function getFirstDayOfMonth(date: Date): Date;
/**
* Get the last day of the month
* @param date - any date in the month
*/
export declare function getLastDayOfMonth(date: Date): Date;
/**
* Get the first day of the year
* @param year - year
*/
export declare function getFirstDayOfYear(year: number): Date;
/**
* Get the last day of the year
* @param year - year
*/
export declare function getLastDayOfYear(year: number): Date;
//# sourceMappingURL=calendar.d.ts.map