import { Nullable } from '../../types/general'; export declare type DateCompareResult = { isPreviousMonth: boolean; isNextMonth: boolean; inMonth: boolean; }; export declare const WEEKDAYS_SHORT: string[]; /** * Calendar date class */ export declare class CalendarDate { private static readonly MONTHS; private _year; private _month; private _date; constructor(year: number, month: number, date: number); /** * Create a calendar date from a Date object * * @param {Date} currentDate - The Date object to create CalendarDate from * @param {string} timezone - Timezone identifier for timezone-aware date creation. If not provided, uses system timezone. * @returns {CalendarDate} - Return a CalendarDate object */ static from(currentDate: Date, timezone?: string): CalendarDate; /** * Converts a date string to CalendarDate with optional format and timezone parameters. * * @param {string} dateString - The string date. * @param {string} [format] - The format of string date * @param {string} [lang] - lang * @returns {Nullable} - CalendarDate. */ static fromString(dateString: string, format?: string, lang?: string): Nullable; /** * Get regex pattern by format token. * * @param {string} token - The format token. * @param {string} lang - Language. * @returns {FormatPatternType} - regex pattern. */ private static getPatternByFormatToken; /** * Shorts months. * * @param {string} lang - Language * @returns {string[]} - Shorts months. */ private static shortMonths; /** * Long months. * * @param {string} lang - Language * @returns {string[]} - Long months. */ private static longMonths; /** * The year of the calendar date * * @type {number} */ get year(): number; set year(value: number); /** * The month of the calendar date * * @type {number} */ get month(): number; set month(value: number); /** * The date of the calendar date * * @type {number} */ get date(): number; set date(value: number); /** * Converts CalendarDate to a string with an optional format specifier. * * @param {string} [format] - The format of string date * @param {string} [lang] - Language * @returns {string} The string date. */ toString(format?: string, lang?: string): string; /** * Verify whether the calendar date is today * * @param {string} timezone - Timezone to consider when checking today's date. If not provided, uses system timezone. * @returns {boolean} - Return true if the calendar date is today. Otherwise, return false. */ isToday(timezone?: string): boolean; /** * Convert the calendar date to a Date object * * @returns {Date} - Return a Date object */ toDate(): Date; /** * Compare with another calendar date * * @param {CalendarDate} date - The calendar date to compare with * @returns {DateCompareResult} - Return a DateCompareResult object */ compare(date: CalendarDate): DateCompareResult; /** * The function "equal" compares the year, month, and date of two CalendarDate objects and returns true if they are equal. * * @param {Nullable} calendarDate - The `equal` method in the code snippet is a function that compares the year, month, and date of the current `CalendarDate` object with another * `CalendarDate` object passed as a parameter. The method returns `true` if all three values (year, month, date) are equal * @returns {boolean} The date is same day with current */ equal(calendarDate: Nullable): boolean; /** * Get month name. * * @param {boolean} isShortName - Whether to get the short name or long name of the month * @returns {string} The name of the month */ getMonthName(isShortName?: boolean): string; /** * To determine if it is larger than a given `CalendarDate`. * * @param {Nullable} calendarDate - A `CalendarDate` * @returns {boolean} - Compared result */ isAfter(calendarDate: Nullable): boolean; /** * To determine if it is less than a given `CalendarDate`. * * @param {Nullable} calendarDate - A `CalendarDate` * @returns {boolean} - Compared result */ isBefore(calendarDate: Nullable): boolean; /** * Get first day of month. * * @returns {CalendarDate} - First day of month. */ firstDateOfMonth(): CalendarDate; /** * Get last day of month. * * @returns {CalendarDate} - Last day of month. */ lastDateOfMonth(): CalendarDate; /** * Adjusts the calendar date by adding the specified number of years, months, and days. * * @param {number} [years=0] - The number of years to add. * @param {number} [months=0] - The number of months to add. * @param {number} [days=0] - The number of days to add. * @returns {CalendarDate} - A new CalendarDate object with the adjusted date. */ add(years?: number, months?: number, days?: number): CalendarDate; /** * Get the short name of the week day for the calendar date. * * @returns {string} - The short name of the week day. */ getWeekDayShortName(): string; /** * Get year, month and day value by format token. * * @param {string} token - The format token. * @param {string} lang - Language. * @returns {string} - year, month and day value. */ private getDateItemByFormatToken; }