@travetto/base
Advanced tools
Comparing version 4.0.5 to 4.0.6
{ | ||
"name": "@travetto/base", | ||
"version": "4.0.5", | ||
"version": "4.0.6", | ||
"description": "Environment config and common utilities for travetto applications.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -115,2 +115,12 @@ const MIN = 1000 * 60; | ||
} | ||
/** | ||
* Determine the number of units between two dates | ||
*/ | ||
static unitsBetween(startDate: Date | number, endDate: Date | number, unit: TimeUnit): number { | ||
const delta = | ||
(typeof endDate === 'number' ? endDate : endDate.getTime()) - | ||
(typeof startDate === 'number' ? startDate : startDate.getTime()); | ||
return delta / TIME_UNITS[unit]; | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
57374
1131