export type dateinput = string | number | Date; /** * Converts a date input to a Date object. * @param {Date | string | number} date - The date input to convert. * @returns {Date} The converted Date object. */ export declare function toDate(date: dateinput): Date; /** * Adds a specified number of days to a given date. * Keeps the time component of the date. * @param {Date} d - The date to which to add days. * @param {number} days - The number of days to add. * @returns {Date} A new Date object with the specified number of days added. */ export declare function addDays(d: Date, days: number): Date; /** * Adds a specified number of months to a given date. * @param {Date} d - The date to which to add days. * @param {number} months - The number of months to add. * @returns {Date} A new Date object with the specified number of months added. */ export declare function addMonths(d: Date, months: number): Date; /** * Gets the first day of a given month. * @param {Date} d - The date for which to get the first day of the month. * @returns {Date} A new Date object representing the first day of the month. */ export declare const beginningOfMonth: (d: Date) => Date; /** * Formats a date in hour format (HH:mm). * @param {Date | string | number} date - The date to format. * @returns {string} The formatted date in hour format. */ export declare function formatDateToHour(date: dateinput): string; /** * Retrieves the name of the day for a given date. * @param {Date | string | number} date - The date for which to retrieve the day name. * @returns The name of the day. */ export declare const getDayName: (date: dateinput, locales?: string, options?: Intl.DateTimeFormatOptions) => string; /** * Returns the day number of a given date. * @param date - The input date. * @returns The day number as a string. */ export declare const getDayNumber: (date: dateinput) => string; /** * Calculates the week number of a given date. * @param {Date | string} date - The date to calculate the week number for. It can be either a string or a Date object. * @param {number} firstDay - The first day of the week. By default, it is set to 1 (Monday). sunday = 0, monday = 1, ... * @returns {number} The week number of the given date. */ export declare function getWeekNumber(date: Date, firstDay?: number): number; /** * Gets the first day of a given week number in a year. * @param {number} weekNumber - The week number. * @param {number} year - The year. * @param {number} firstDay - The first day of the week. By default, it is set to 1 (Monday). sunday = 0, monday = 1, ... * @returns {Date} The first day of the specified week number in the specified year. */ export declare function getFirstDayOfWeek(weekNumber: number, year: number, firstDay?: number): Date; /** * Gets the first day of a given week. */ export declare const beginningOfWeek: (d: Date, startDow?: number) => Date; /** * Gets the last day of a given week. */ export declare const endOfWeek: (d: Date, startDow: number) => Date; /** * Get the date pattern based on the locale * @param locale * @returns */ export declare function getDatePattern(locale: string): string; /** * Checks if two dates are equal, ignoring the time component. * @param {Date | string} date1 - The first date to compare. * @param {Date | string} date2 - The second date to compare. * @returns {boolean} True if the dates are equal, false otherwise. */ export declare function areDatesEqual(date1: dateinput, date2: dateinput): boolean; /** * Day number of the year * @param date * @returns */ export declare function getDayOfYear(date: Date): number; /** * Calculates the difference in minutes between two dates. * @param {Date | string} date1 - The first date. * @param {Date | string} date2 - The second date. * @returns {number} The difference in minutes between the two dates. */ export declare function differenceInMinutes(date1: string | Date, date2: string | Date): number; /** * Number of whole days between two dates. If present, time of day is ignored. * Treats dates as UTC to avoid DST changes within the perioud leading to incorrect * answers (#150). * @param {Date} d1 - The first date. * @param {Date} d2 - The second date. * @returns {number} The number of whole days between the two dates. */ export declare function dayDiff(d1: Date, d2: Date): number; /** * Gets the start of the day for a given date. * @param {Date | string} date - The date for which to get the start of the day. * @returns {Date} A new Date object representing the start of the day. */ export declare function startOfDay(date: dateinput): Date; /** * Gets the end of the day for a given date. * @param {Date | string} date - The date for which to get the end of the day. * @returns {Date} A new Date object representing the end of the day. */ export declare function endOfDay(date: dateinput): Date; /** * Gets the hours from a given date. * @param {Date | string} date - The date from which to extract the hours. * @returns {number} The hours (0-23) extracted from the date. */ export declare function getHours(date: dateinput): number; /** * Gets the minutes from a given date. * @param {Date | string} date - The date from which to extract the minutes. * @returns {number} The minutes (0-59) extracted from the date. */ export declare function getMinutes(date: dateinput): number; /** * Gets each hour of an interval between two dates. * @param {Date | string} startDate - The start date of the interval. * @param {Date | string} endDate - The end date of the interval. * @returns {Date[]} An array of Date objects representing each hour within the interval. */ export declare function eachHourOfInterval(startDate: dateinput, endDate: dateinput): Date[]; /** * Converts a time to pixel value based on the current date and hour pixel width. * @param {Date} time - The time to convert. * @param {Date} currentDate - The current date. * @param {number} hourPixelWidth - The width of an hour in pixels. * @returns {number} The pixel value. */ export declare function time2Pixel(time: Date, currentDate: Date, hourPixelWidth: number): number; /** * Compares two dates in ascending order. * @param {Date | string} date1 - The first date to compare. * @param {Date | string} date2 - The second date to compare. * @returns {number} -1 if date1 is earlier than date2, 1 if date1 is later than date2, 0 if they are equal. */ export declare function compareAsc(date1: dateinput, date2: dateinput): number; export declare function parseDate(input: string, locale: string): Date | null; declare const _default: { addDays: typeof addDays; addMonths: typeof addMonths; areDatesEqual: typeof areDatesEqual; beginningOfMonth: (d: Date) => Date; beginningOfWeek: (d: Date, startDow?: number) => Date; compareAsc: typeof compareAsc; dayDiff: typeof dayDiff; differenceInMinutes: typeof differenceInMinutes; eachHourOfInterval: typeof eachHourOfInterval; endOfDay: typeof endOfDay; endOfWeek: (d: Date, startDow: number) => Date; formatDateToHour: typeof formatDateToHour; getDatePattern: typeof getDatePattern; getDayName: (date: dateinput, locales?: string, options?: Intl.DateTimeFormatOptions) => string; getDayNumber: (date: dateinput) => string; getDayOfYear: typeof getDayOfYear; getFirstDayOfWeek: typeof getFirstDayOfWeek; getHours: typeof getHours; getMinutes: typeof getMinutes; getWeekNumber: typeof getWeekNumber; parseDate: typeof parseDate; startOfDay: typeof startOfDay; time2Pixel: typeof time2Pixel; toDate: typeof toDate; }; export default _default;