general: snapshot

This commit is contained in:
k
2024-07-12 08:35:41 +02:00
parent 350c835873
commit 35fd5054aa
51 changed files with 2831 additions and 3251 deletions

View File

@@ -4,3 +4,10 @@ export const dateToString = (date: Date) => date.toJSON().split("T")[0];
export const getNumberOfDaysBetweenTwoDates = (oldest: Date, youngest: Date) =>
Math.round(Math.abs((youngest.getTime() - oldest.getTime()) / ONE_DAY_IN_MS));
export function dateFromTime(time: Time) {
return typeof time === "string"
? new Date(time)
: // @ts-ignore
new Date(time.year, time.month, time.day);
}