es-next-tools
Version:
A comprehensive utility library for JavaScript and TypeScript that provides a wide range of functions for common programming tasks, including mathematical operations, date manipulations, array and object handling, string utilities, and more.
12 lines (11 loc) • 415 B
TypeScript
/**
* Calculates the difference in days between two dates.
* @param {Date} date1 - The first date.
* @param {Date} date2 - The second date.
* @returns {number} The number of days between the two dates.
* @example
* const date1 = new Date('2023-01-01');
* const date2 = new Date('2023-01-10');
* const difference = diff(date1, date2); // 9
*/
export declare function diff(date1: Date, date2: Date): number;