export declare enum DayOfTheWeek { MONDAY = 1, TUESDAY = 2, WEDNESDAY = 3, THURSDAY = 4, FRIDAY = 5, SATURDAY = 6, SUNDAY = 7 } type AddMonthsOptions = { /** If true, the days that don't exist in the new month overflow into the next month. */ overflow?: boolean; }; type DifferenceInDaysOptions = { /** If true, the result is never negative. */ absolute?: boolean; }; export declare class CalendarDate { readonly year: number; /** * Month of the year starting from 1 */ readonly month: number; /** * Day of the month starting from 1 */ readonly day: number; /** * Seconds passed since the unix epoch. Always calculated with a time and timezone set to T00:00:00.00Z. */ readonly unixTimestampInSeconds: number; /** * Day of the week starting from monday according to ISO 8601. Values from 1-7. */ readonly weekday: DayOfTheWeek; /** * cache for Intl.DateTimeFormat instances * @private */ private static dateTimeFormatterByTimezone; /** * cache for Intl.DateTimeFormat instances used by toFormat * @private */ private static dateTimeFormatterByLocaleAndOptions; /** * The minimum representable CalendarDate: 0001-01-01. * Intended as a sentinel value instead of null, e.g. to model a date range with an open start. */ static readonly MIN_VALUE: CalendarDate; /** * The maximum representable CalendarDate: 9999-12-31. * Intended as a sentinel value instead of null, e.g. to model a date range with an open end. */ static readonly MAX_VALUE: CalendarDate; /** * Customizes the default string description for instances of `CalendarDate`. */ get [Symbol.toStringTag](): string; /** * Throws an Error for invalid inputs. * * @param isoString Format: yyyy-MM-dd */ constructor(isoString: string); /** * Throws an Error for invalid inputs. * * @param year Integer between 1-9999 * @param month Integer between 1-12 * @param day Integer between 1-31 */ constructor(year: number, month: number, day: number); static isLeapYear(year: number): boolean; static getMaxDayOfMonth(year: number, month: number): number; /** * Creates a Date in local time. Sets the year explicitly because the Date constructor * maps years 0-99 to 1900-1999. */ private static createDateLocal; private static getIntlDateTimeFormatter; /** * returns a CalendarDate instance for the supplied Date, using UTC values. * Throws an Error for an invalid Date. */ static fromDateUTC(date: Date): CalendarDate; /** * returns a CalendarDate instance for the supplied Date, using local time zone values. * Throws an Error for an invalid Date. */ static fromDateLocal(date: Date): CalendarDate; /** * returns a CalendarDate instance for the supplied Date, using the supplied time zone string */ static fromDateWithTimeZone(date: Date, timeZone: string): CalendarDate; /** * returns a CalendarDate instance for the current UTC Date */ static nowUTC(): CalendarDate; /** * returns a CalendarDate instance for the current Date using the local time zone of your environment */ static nowLocal(): CalendarDate; /** * returns a CalendarDate instance for the current Date using the supplied time zone string */ static nowTimeZone(timeZone: string): CalendarDate; /** * * @param isoString pattern YYYY-MM-DD */ static parse(isoString: string): CalendarDate; static max(...values: CalendarDate[]): CalendarDate; static min(...values: CalendarDate[]): CalendarDate; /** * Returns a copy of the supplied array of CalendarDates sorted ascending */ static sortAscending(calendarDates: CalendarDate[]): CalendarDate[]; /** * Returns a copy of the supplied array of CalendarDates sorted descending */ static sortDescending(calendarDates: CalendarDate[]): CalendarDate[]; /** * Returns the ISO string representation yyyy-MM-dd */ toString(): string; /** * Returns a string representation formatted according to the specified format string. * Supports the following Tokens: * * - **yyyy**: four digit year * - **yy**: two digit year * - **y**: year without padding * - **MM**: month padded to 2 digits * - **M**: month without padding * - **dd**: day padded to 2 digits * - **d**: day without padding * * Text in single quotes is kept as is, e.g. `"dd 'de' MM"`. Two single quotes stand for one, * inside or outside of quoted text. Throws an Error if quoted text has no closing quote. */ toFormat(pattern: string): string; /** * Returns a string representation formatted with the Intl.DateTimeFormat API. */ toFormat(locales: string, options: Pick): string; /** * Used by JSON stringify method. */ toJSON(): string; toDateUTC(): Date; toDateLocal(): Date; /** * Returns the unix timestamp in seconds. */ valueOf(): number; equals(calendarDate: CalendarDate): boolean; /** * Checks if the month and year of this CalendarDate are the same as the month and year of the supplied CalendarDate. */ isSameMonth(calendarDate: CalendarDate): boolean; /** * Checks if the year of this CalendarDate is the same as the year of the supplied CalendarDate. */ isSameYear(calendarDate: CalendarDate): boolean; isBefore(calendarDate: CalendarDate): boolean; isAfter(calendarDate: CalendarDate): boolean; isBeforeOrEqual(calendarDate: CalendarDate): boolean; isAfterOrEqual(calendarDate: CalendarDate): boolean; /** * Returns a new CalendarDate with the specified amount of months added. * Throws an Error if the amount is not an integer. * * If the day doesn't exist in the new month, the last day of that month is returned. With * `{ overflow: true }` the remaining days overflow into the next month instead. */ addMonths(amount: number, options?: AddMonthsOptions): CalendarDate; /** * Returns a new CalendarDate with the specified amount of years added. * Throws an Error if the amount is not an integer. * * February 29 becomes February 28 in a year that is not a leap year. With `{ overflow: true }` it * overflows to March 1 instead. */ addYears(amount: number, options?: AddMonthsOptions): CalendarDate; /** * Returns a new CalendarDate with the specified amount of days added. * Allows overflow. Throws an Error if the amount is not an integer. */ addDays(amount: number): CalendarDate; /** * Returns a new CalendarDate with the specified amount of weeks added. * Throws an Error if the amount is not an integer. */ addWeeks(amount: number): CalendarDate; getLastDayOfMonth(): CalendarDate; getFirstDayOfMonth(): CalendarDate; isFirstDayOfMonth(): boolean; isLastDayOfMonth(): boolean; /** * returns the last day (sunday) of the week of this calendar date as a new calendar date object. */ getLastDayOfWeek(): CalendarDate; /** * returns the first day (monday) of the week of this calendar date as a new calendar date object. */ getFirstDayOfWeek(): CalendarDate; /** * returns true if the weekday is monday(1) */ isFirstDayOfWeek(): boolean; /** * returns true if the weekday is sunday(7) */ isLastDayOfWeek(): boolean; /** * returns the first day (january 1) of the year of this calendar date as a new calendar date object. */ getFirstDayOfYear(): CalendarDate; /** * returns the last day (december 31) of the year of this calendar date as a new calendar date object. */ getLastDayOfYear(): CalendarDate; /** * returns the first day of the quarter of this calendar date as a new calendar date object. */ getFirstDayOfQuarter(): CalendarDate; /** * returns the last day of the quarter of this calendar date as a new calendar date object. */ getLastDayOfQuarter(): CalendarDate; /** * returns true if the calendar date is january 1 */ isFirstDayOfYear(): boolean; /** * returns true if the calendar date is december 31 */ isLastDayOfYear(): boolean; /** * returns true if the calendar date is the first day of the quarter (january 1, april 1, july 1 or october 1) */ isFirstDayOfQuarter(): boolean; /** * returns true if the calendar date is the last day of the quarter (march 31, june 30, september 30 or december 31) */ isLastDayOfQuarter(): boolean; /** * subtracts the input CalendarDate from this CalendarDate and returns the difference in days. * With `{ absolute: true }` the result is never negative. */ getDifferenceInDays(calendarDate: CalendarDate, options?: DifferenceInDaysOptions): number; /** * The number of the week of the year that the day is in. By definition (ISO 8601), the first week of a year contains January 4 of that year. * (The ISO-8601 week starts on Monday.) In other words, the first Thursday of a year is in week 1 of that year. (for timestamp values only). * [source: https://www.postgresql.org/docs/8.1/functions-datetime.html] */ get week(): number; /** * The ISO 8601 week-numbering year the date belongs to. Around the turn of the year this can * differ from the calendar year: e.g. 2023-01-01 is in week 52 of the week-numbering year 2022 * and 2025-12-29 is in week 1 of the week-numbering year 2026. */ get weekYear(): number; /** * Returns the Thursday of the week of this date as days since the unix epoch. * The year of this Thursday decides the ISO 8601 week-numbering year. */ private getThursdayOfWeek; /** * The quarter of the year (1-4) based on the month of the date. * * Quarter breakdown: * - 1st Quarter: January to March (1-3) * - 2nd Quarter: April to June (4-6) * - 3rd Quarter: July to September (7-9) * - 4th Quarter: October to December (10-12) */ get quarter(): number; } export {};