import dayjs from 'dayjs'; import { Granularity } from '../components/_inputs/granular-date-range/types'; /** * -------------------------------------------- * Date formats * -------------------------------------------- */ export declare const UI_INPUT_FORMATS: readonly ["D/M/YYYY", "DD/MM/YYYY"]; export declare const API_FORMAT = "YYYY-MM-DD"; export declare const API_MONTH_FORMAT = "YYYY-MM"; export declare const API_YEAR_FORMAT = "YYYY"; export declare const UI_OUTPUT_FORMAT = "DD/MM/YYYY"; export declare const UI_OUTPUT_MONTH_FORMAT = "MMM YY"; export declare const UI_OUTPUT_YEAR_FORMAT = "YYYY"; export declare const UI_SHORT_YEAR_FORMAT = "DD/MM/YY"; export declare const UI_DATE_TIME_FORMAT = "DD/MM/YYYY HH:mm"; export declare const UI_DATE_TIME_SHORT_YEAR_FORMAT = "DD/MM/YY HH:mm"; export declare const UI_SHORT_DAY_SHORT_YEAR_FORMAT = "D/M/YY"; export declare const UI_SHORT_DAY_DATE_TIME_FORMAT = "D/M/YYYY HH:mm"; export declare const UI_SHORT_DAY_MONTH_YEAR_DATE_TIME_FORMAT = "D/M/YY HH:mm"; export declare const allDateFormats: string[]; /** * -------------------------------------------- * Validation helpers * -------------------------------------------- */ export declare function isValidUiDate(value?: string): boolean; export declare function parseIfDate(value: string): dayjs.Dayjs | null; /** * -------------------------------------------- * Transform helpers * -------------------------------------------- */ /** * DD/MM/YYYY -> YYYY-MM-DD * * @export * @param {string} [value] * @return {*} {(string | undefined)} */ export declare function uiDateToApi(value?: string): string | undefined; /** * YYYY-MM-DD -> DD/MM/YYYY * * @export * @param {string} [value] * @return {*} {(string | undefined)} */ export declare function apiDateToUi(value?: string, granularity?: Granularity): string | undefined; /** * TS -> DD/MM/YYYY * * @export * @param {(string | Date)} [value] * @return {*} {(string | undefined)} */ export declare function apiTimestampToUiDate(value?: string | Date): string | undefined; /** * TS -> DD/MM/YYYY HH:mm * * @export * @param {(string | Date)} [value] * @return {*} {(string | undefined)} */ export declare function apiTimestampToUiDateTime(value?: string | Date): string | undefined; /** * -------------------------------------------- * Display helpers * -------------------------------------------- */ export declare function formatDateOrUnset(value?: string): string; export declare function todayAsApiDate(): string; export declare function todayAsUiDate(): string; export declare function todayAsUiDateTime(): string; export declare function toDate(value: unknown): Date | undefined; export declare const getGranularityFromDateFormat: (dateValue: string) => Granularity;