export type TDateFormat = | 'd/m/yy' | 'm/d/yy' | 'd/mm/yy' | 'dd/mm/yy' | 'dd/mm/yyyy' | 'dd M yy' | 'dd M yyyy' | 'dd MM yy' | 'dd MM yyyy' | 'D dd M yy' | 'D dd M yyyy' | 'DD dd MM yy' | 'DD dd MM yyyy' | 'D, dd M yy' | 'D, dd M yyyy' | 'DD, dd MM yy' | 'DD, dd MM yyyy'; export type GoDateLayout = | '02/01/06' | '_2/_1/06' | '_1/_2/06' | '02 Jan 06' | 'Mon, 02 Jan 06' | 'Mon, 02 Jan 2006'; export type TTimeFormat = 'HH:mm' | 'HH:mm a' | 'HH:mm:ss' | 'HH:mm:ss a'; export type GoTimeLayout = '15:04' | '03:04 PM' | '15:04:05' | '03:04:05 PM'; export type CustomDateTimeFormatOptions = Omit< Intl.DateTimeFormatOptions, 'timeZone' > & { timezone?: string; locale?: string; }; export type DateOptions = { locale?: string; dateFormat?: TDateFormat | GoDateLayout; timeFormat?: TTimeFormat | GoTimeLayout; timezone?: string; /** * Show the time in the formatted date. * * @default false - But will be set to true when `DateOptions.timeFormat` is provided */ showTime?: boolean; /** * Show the date in the formatted date. * * @default true */ showDate?: boolean; /** * This is old format (general settings), if configuration still using old settings then this option parameter can be used */ formatPreset?: CustomDateTimeFormatOptions; }; export declare const formatDate: ( date: Date, options?: DateOptions, /** * If general settings is provided, automatically use general settings * Turn it off if you want to avoid general settings usage even when general settings is available * * Just ignore this parameter if your project doesn't utilize general settings * * Note: DateOptions has higher priority than this option. When DateOptions specified by user, it will overides General Settings. */ useGeneralSettings?: boolean, ) => string; export declare const formatISODate: (date: string | Date) => string; /** * Formats a date to human readable form (timeago / relative time from now). * * @param date - The date to be displayed. Can be a Date object or a string in a recognized date format. * @param maxSeconds - Max value of seconds difference. Use it for formats a date according to the user's general settings. * @returns The formatted date string. */ export declare const formatDateReadable: ( date: Date, maxSeconds?: number, ) => string; /** * A better "formatDateReadable" * @param date * @param maxSeconds * @param lang * @returns */ export declare const formatTimeAgo: ( date: Date, maxSeconds?: number, lang?: string, ) => string; export declare const getRemainingTime: (deadline: string) => { seconds: number; days: number; hours: number; minutes: number; }; export declare const isISODateString: (value: string) => boolean;