2021-05-16 21:20:46 +00:00
|
|
|
/**
|
|
|
|
* Get number of days between two Date objects
|
|
|
|
* @param startdate
|
|
|
|
* @param enddate
|
|
|
|
*/
|
|
|
|
|
|
|
|
export function getDays(startdate: Date, enddate: Date): number {
|
2023-04-30 16:32:28 +00:00
|
|
|
const startMS = startdate.getTime();
|
|
|
|
const endMS = enddate.getTime();
|
2021-05-16 21:20:46 +00:00
|
|
|
|
2023-04-30 16:32:28 +00:00
|
|
|
return Math.ceil((endMS - startMS) / (24 * 60 * 60 * 1000));
|
2021-05-16 21:20:46 +00:00
|
|
|
}
|