/** * Parses a string representing a timestamp using the given format into a `Date` object. * @param {string} string The date-time string to be parsed * @param {string} format The format against which to parse the date-time string * @param {Date | null} [defaultValue] If the string cannot be properly parsed against the format string, this is returned * @returns {Date | null} The date object representing the given string */ export function parseDateTime(string: string, format: string, defaultValue?: Date | null | undefined): Date | null; /** * Formats a given `Date` object into a string representation. * @param {Date | null} datetime The timestamp to be formatted * @param {string} format The format to which the given timestamp will be formatted */ export function formatDateTime(datetime: Date | null, format: string): string | null; /** * Generates an array with the names of the days of the week for the given locale. * @param {string | string[] | undefined} locale The locale(s) in which the day names should be output. Pass an empty array to use the default locale. Read more on the [MDN docs](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#locales_argument) * @param {0 | 1 | 2 | 3 | 4 | 5 | 6} firstWeekday First day of the week. 1 = Monday. * @returns {[string, string, string, string, string, string, string]} */ export function getWeekdays(locale: string | string[] | undefined, firstWeekday: 0 | 1 | 2 | 3 | 4 | 5 | 6): [string, string, string, string, string, string, string]; /** * Check if the given object is a date. * @param {*} date The object to check * @returns {date is Date} `true` if the given object is a valid `Date`, `false` otherwise */ export function isDate(date: any): date is Date; /** * Check for equality between 2 `Date` objects, disregarding the time. * @param {Date | null} date1 * @param {Date | null} date2 * @returns {boolean} */ export function datesEqual(date1: Date | null, date2: Date | null): boolean; /** * Check for equality between 2 `Date` objects, including the time (hours, minutes, and seconds only). * @param {Date | null} date1 * @param {Date | null} date2 * @returns {boolean} */ export function dateTimesEqual(dt1: any, dt2: any): boolean; /** * Checks if the date of the first `Date` object came before the date of the second (disregards time). * @param {Date | null} date1 * @param {Date | null} date2 * @returns {boolean} */ export function datesLessEqual(date1: Date | null, date2: Date | null): boolean; /** * Checks if the date is included in the given array of dates or ranges. * @param {Date} date The date object whose inclusion is to be checked * @param {Array} dateRanges The set of dates * @returns {boolean} */ export function dateIncluded(date: Date, dateRanges: Array): boolean; /** * Generates a calendar view of a given month. * @param {0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11} month Zero-based numeric value for month. 0 = January * @param {number} year * @param {0 | 1 | 2 | 3 | 4 | 5 | 6} firstWeekday First day of the week. 1 = Monday * @param {Array} disabledDates * @returns {Array>} */ export function getCalendar(month: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11, year: number, firstWeekday: 0 | 1 | 2 | 3 | 4 | 5 | 6, disabledDates?: Array): Array>; /** * Copies the date (day, month, and year) from the first `Date` object to the second. * @template {Date | null} T1 * @template {Date | null} T2 * @param {T1} source The object to copy the date from * @param {T2} destination The object to which the date will be copied, modified in-place * @returns {T1 extends null ? T1 : T2 extends null ? T1 : T2} The modified object */ export function applyDate(source: T1, destination: T2): T1 extends null ? T1 : T2 extends null ? T1 : T2; /** * Copies the time (hour, minute, and second) from the first `Date` object to the second. * @template {Date | null} T1 * @template {Date | null} T2 * @param {T1} source The object to copy the time from * @param {T2} destination The object to which the time will be copied, modified in-place * @returns {T1 extends null ? T1 : T2 extends null ? T1 : T2} The modified object */ export function applyTime(source: T1, destination: T2): T1 extends null ? T1 : T2 extends null ? T1 : T2; /** * Copy a Date object, respecting null values. * @template {Date | null} T * @param {T} date The object from which a copy should be made * @returns {T} The clone of the given object */ export function copyDate(date: T): T; //# sourceMappingURL=datetime-utils.d.ts.map