@technobuddha/library
Version:
A large library of useful functions
20 lines (19 loc) • 608 B
TypeScript
/**
* Options for the {@link relativeTime} function
* @group Time
* @category Relative Time
*/
export type DurationOptions = {
/** Number of decimal places for seconds */
fractionDigits?: number;
};
/**
* Describe duration between two dates in a simple format
* @param start - The date
* @param finish - The date to compare to
* @param options - see {@link DurationOptions}
* @returns string describing the duration between the two dates
* @group Time
* @category Relative Time
*/
export declare function duration(start: Date, finish: Date, { fractionDigits }?: DurationOptions): string;