reablocks
Version:
Component library for React
14 lines (13 loc) • 526 B
TypeScript
export interface SafeFormatOptions {
/** The date-fns format string used to format the absolute date. */
format: string;
/** Whether to include seconds when computing the relative time string. */
includeSeconds?: boolean;
/** Whether to append a suffix (e.g. "ago", "in") to the relative time string. */
addSuffix?: boolean;
}
export declare function safeFormat(date: Date | string | number | null | undefined, options: SafeFormatOptions): {
dateObj: any;
formatted: any;
relative: any;
};