import { DateDuration, DateFormat, DateRange } from './interface'; /** * @param {Date} date What you wish to normalize * @param {(value: Date | number) => Date} dateFn A date function that takes in a date and applies some logic and returns a date * @returns {Date} normalized Date */ export declare function normalizeDateFunc(date: Date, dateFn: (value: Date | number, ...args: any[]) => Date, ...args: any[]): Date; /** * @param {number | Date} date - a given date * @param {number} amount - number of days to add to the date * @returns {Date} Returns a date that is "amount" of days in the future from the provided date. */ export declare function addDays(date: number | Date, amount: number): Date; /** * @param {number | Date} value - a given date * @param {number} amount - number of days to subtract from the date * @returns {Date} Returns a date that is "amount" of days in the past from the provided date. */ export declare function subtractDays(value: number | Date, amount: number): Date; /** * @param {number | Date} value - a given date * @param {number} amount - number of months to subtract from the date * @returns {Date} Returns a date that is "amount" of months in the past from the provided date. */ export declare function subtractMonths(value: number | Date, amount: number): Date; /** * @param {number | Date} value - a given date * @param {number} amount - number of years to subtract from the date * @returns {Date} Returns a date that is "amount" of years in the past from the provided date. */ export declare function subtractYears(value: number | Date, amount: number): Date; /** * Given a date, a number, and either days or months we return a date that is that amount of days in the past to find the start date. * @example * // returns Tue Nov 14 2020 * calculateStartDate(Tue Nov 17 2020, 3, 'days') * @example * // returns Thu Sept 17 2020 * calculateStartDate(Thu Sept 17 2020, 2, 'months') * @param {number | Date} endDate - the end date of date range * @param {number} dur - the number of date units the date range is * @parm {DateDuration} unit - specifies whether we to "dur" days or "dur" months into the past for the start date * @returns {Date} Returns the date that is either "dur" days or "dur" months in the past in relation to the provided end date */ export declare function calculateStartDate(endDate: number | Date, dur: number, unit: DateDuration): Date; /** * @param {number | Date} value - a given date * @returns {string} Returns a localized string representation of the given date */ export declare function formatDate(value: number | Date, dateFormat?: DateFormat | string, locale?: Locale): string; /** * @param {number | Date} value - a given date * @returns {string} Returns a string representation of the given date in the UTC timezone */ export declare function formatUTCDate(value: number | Date, dateFormat?: DateFormat | string, locale?: Locale): string; /** * @param {DateRange} dateRange - An object with start and end properties, both properties are of type Date * @returns {string} Returns a localized string representation of the start and end date, separated by a "-" */ export declare function formatDateRange(dateRange: DateRange): string; /** * @param date A date object * @returns {number} Returns the number of milliseconds that represent the timezone offset */ export declare function getTimezoneOffsetInMilliseconds(): number; /** * @param {number|Date} value A date object or a numerical timestamp * @returns {Date} returns the UTC time based off of the timezone of the client */ export declare function getUTCTime(value: number | Date): Date; /** * @param {number | Date} value - a given date * @returns {Date} Returns the given date at the start of the day (midnight) */ export declare function getStartOfDay(value: number | Date): Date; /** * @param {number | Date} value - a given date * @returns {Date} Returns the given date at the start of the day (midnight) in UTC */ export declare function getUTCStartOfDay(value: number | Date): Date; /** * @param {number | Date} value - a given date * @returns {Date} Returns the given date at the end of the day (minute before midnight) */ export declare function getEndOfDay(value: number | Date): Date; /** * @param {number | Date} value - a given date * @returns {Date} Returns the given date at the end of the day (minute before midnight) in UTC */ export declare function getUTCEndOfDay(value: number | Date): Date; /** * @param {number | Date} value - a given date * @returns {Date} Returns the given date at the start of the month (midnight) */ export declare function getStartOfMonth(value: number | Date): Date; /** * @param {number | Date} value - a given date * @returns {Date} Returns the given date at the start of the month (midnight) in UTC */ export declare function getUTCStartOfMonth(value: number | Date): Date; /** * @param {number | Date} value - a given date * @returns {Date} Returns the given date at the end of the month (minute before midnight) */ export declare function getEndOfMonth(value: number | Date): Date; /** * @param {number | Date} value - a given date * @returns {Date} Returns the given date at the end of the month (minute before midnight) in UTC */ export declare function getUTCEndOfMonth(value: number | Date): Date; /** * @param {number | Date} endDate - a given date * @param {number | Date} startDate - a givend date, either on the same day as endDate, or in the past. * @returns {number} Returns the number of days in between the startDate and endDate. */ export declare function differenceInDays(endDate: number | Date, startDate: number | Date): number; /** * @param {number | Date} endDate - a given date * @param {number | Date} startDate - a givend date, either on the same day as endDate, or in the past. * @returns {number} Returns the number of months in between the startDate and endDate. */ export declare function differenceInMonths(endDate: number | Date, startDate: number | Date): number; /** * @param {number | Date} dateTwo - a date object you want to compare against * @returns {boolean} Returns true if dateOne and dateTwo are dates with the same day */ export declare function isSameDay(dateOne: number | Date, dateTwo: number | Date): boolean; /** * @param {number | Date} dateOne - a date object you want to compare with * @param {number | Date} dateTwo - a date object you want to compare against * @returns {boolean} Returns true if dateOne is before dateTwo */ export declare function isBefore(dateOne: number | Date, dateTwo: number | Date): boolean; /** * @param {number | Date} value - a given date * @param {number | Date} comparisonValue - a given date as the base for the relative comparison * @returns {string} Returns a localized string representation of the given date relative to the given base date */ export declare function formatTimeBetween(value: number | Date, comparisonValue: number | Date, includeSeconds?: boolean, addSuffix?: boolean, locale?: Locale): string; /** * @param {number | Date} value - a given date * @returns {string} Returns a localized string representation of the given date relative to now (ex: "3 days ago") */ export declare function fromNow(value: number | Date, locale?: Locale): string; /** * In North America, weeks start on Sundays, but other locales start the week on Monday or Saturday. * This function returns the days of the week in order for a locale. * @returns {string[]} week in localized order (indexed to north american week order) */ export declare function localizedWeekOrder(locale?: Locale): number[]; /** * In North America, weeks start on Sundays, but other locales start the week on Monday or Saturday. * This function maps a given index to the day of the week at the current locale. * Ex. The 0th weekday in Canada is Sunday (0 -> 0), the 0th weekday in Germany is Monday (0 -> 1) * @param {number} index - the requested index * @returns {number} day of the week for a weekday (indexed to north american week order) */ export declare function localizedWeekday(index: number, locale?: Locale): number; /** * In North America, weeks start on Sundays, but other locales start the week on Monday or Saturday. * This function compares the locale against known values for the first day of the week. * @returns {string} first three letters of a day of the week */ export declare function localizedWeekStart(locale?: Locale): string;