95caba340a
* Added getHours function
15 lines
337 B
TypeScript
15 lines
337 B
TypeScript
/**
|
|
* Get number of days between two Date objects
|
|
* @param startdate
|
|
* @param enddate
|
|
*/
|
|
|
|
export function getDays(startdate: Date, enddate: Date): number {
|
|
let result, startMS, endMS;
|
|
startMS = startdate.getTime();
|
|
endMS = enddate.getTime();
|
|
result = Math.ceil((endMS - startMS) / (24 * 60 * 60 * 1000));
|
|
|
|
return result;
|
|
}
|