/** * 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; /** * Get the nth occurrence of a day in a month (e.g., 2nd Monday) * @param year - year * @param month - month (0-11) * @param dayOfWeek - day of week (0=Sunday, 6=Saturday) * @param n - occurrence (1-5, or -1 for last) */ export declare function getNthDayOfMonth(year: number, month: number, dayOfWeek: number, n: number): Date | null; /** * US Holiday type */ export interface USHoliday { name: string; date: Date; type: 'federal' | 'observance'; } /** * Get New Year's Day * @param year - year */ export declare function getNewYearsDay(year: number): Date; /** * Get Martin Luther King Jr. Day (3rd Monday of January) * @param year - year */ export declare function getMLKDay(year: number): Date | null; /** * Get Presidents' Day (3rd Monday of February) * @param year - year */ export declare function getPresidentsDay(year: number): Date | null; /** * Get Memorial Day (last Monday of May) * @param year - year */ export declare function getMemorialDay(year: number): Date | null; /** * Get Independence Day (July 4th) * @param year - year */ export declare function getIndependenceDay(year: number): Date; /** * Get Labor Day (1st Monday of September) * @param year - year */ export declare function getLaborDay(year: number): Date | null; /** * Get Columbus Day (2nd Monday of October) * @param year - year */ export declare function getColumbusDay(year: number): Date | null; /** * Get Veterans Day (November 11th) * @param year - year */ export declare function getVeteransDay(year: number): Date; /** * Get Thanksgiving Day (4th Thursday of November) * @param year - year */ export declare function getThanksgivingDay(year: number): Date | null; /** * Get Christmas Day (December 25th) * @param year - year */ export declare function getChristmasDay(year: number): Date; /** * Get Good Friday (Friday before Easter) * @param year - year */ export declare function getGoodFriday(year: number): Date; /** * Get all US federal holidays for a year * @param year - year */ export declare function getUSHolidays(year: number): USHoliday[]; /** * Check if a date is a US federal holiday * @param date - date to check */ export declare function isUSHoliday(date: Date): boolean; /** * Get the name of a US holiday for a given date * @param date - date to check * @returns holiday name or null if not a holiday */ export declare function getUSHolidayName(date: Date): string | null; /** * Get the start of the week for a date (Monday) * @param date - any date */ export declare function getStartOfWeek(date: Date): Date; /** * Get the end of the week for a date (Sunday) * @param date - any date */ export declare function getEndOfWeek(date: Date): Date; /** * Get all weeks in a month as arrays of dates * @param year - year * @param month - month (0-11) */ export declare function getWeeksInMonth(year: number, month: number): Date[][]; /** * Get the ISO week-numbering year (year the week belongs to) * @param date - date to get week year for * @returns The year the ISO week belongs to (may differ from calendar year) * @example * getWeekYear(new Date('2024-01-01')) // 2024 * getWeekYear(new Date('2020-12-31')) // 2020 (belongs to week 53 of 2020) */ export declare function getWeekYear(date: Date): number; /** * Get the last day of the decade containing the date * @param date - any date * @returns December 31 of the last year of the decade * @example * lastDayOfDecade(new Date('2024-06-15')) // 2029-12-31 */ export declare function lastDayOfDecade(date: Date): Date; /** * Get the first day of the decade containing the date * @param date - any date * @returns January 1 of the first year of the decade * @example * firstDayOfDecade(new Date('2024-06-15')) // 2020-01-01 */ export declare function firstDayOfDecade(date: Date): Date; /** * Get the last day of the century containing the date * @param date - any date * @returns December 31 of the last year of the century * @example * lastDayOfCentury(new Date('2024-06-15')) // 2099-12-31 */ export declare function lastDayOfCentury(date: Date): Date; /** * Get the start of a quarter * @param date - any date * @returns First day of the quarter */ export declare function getStartOfQuarter(date: Date): Date; /** * Get the end of a quarter * @param date - any date * @returns Last day of the quarter */ export declare function getEndOfQuarter(date: Date): Date; //# sourceMappingURL=calendar.d.ts.map