reablocks
Version:
Component library for React
10 lines (9 loc) • 473 B
TypeScript
export declare function getDifference(date: Date): number;
export interface FormatRelativeOptions {
/** Whether to append a suffix (e.g. "ago", "in") to the relative time string. */
addSuffix?: boolean;
/** Whether to include seconds in the relative time string. */
includeSeconds?: boolean;
}
export declare function formatRelative(date: Date, options?: FormatRelativeOptions): string;
export declare function getInterval(date: Date): 0 | 60000 | 3600000;