mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-13 15:36:25 +00:00
12 lines
375 B
TypeScript
12 lines
375 B
TypeScript
const ONE_MINUTE_MS = 60 * 1000;
|
|
const ONE_DAY_MS = 24 * 60 * ONE_MINUTE_MS;
|
|
|
|
export function getElapsedDays(timestamp: string): number {
|
|
return Math.floor(
|
|
(new Date().getTime() - new Date(timestamp).getTime()) / ONE_DAY_MS
|
|
);
|
|
}
|
|
|
|
export function getElapsedMinutes(date: Date): number {
|
|
return Math.floor((new Date().getTime() - date.getTime()) / ONE_MINUTE_MS);
|
|
}
|