diff options
| author | ivarlovlie <git@ivarlovlie.no> | 2022-11-14 03:23:46 +0100 |
|---|---|---|
| committer | ivarlovlie <git@ivarlovlie.no> | 2022-11-14 03:23:46 +0100 |
| commit | 04153710828a9016feb82ebd01e8914b9bb59b4d (patch) | |
| tree | f4d75b8fc6285bf601c0ce18fa55d480e25c6197 /code/app | |
| parent | 04315a5555e8796f4459524421a8daf4f83ddfc1 (diff) | |
| download | greatoffice-04153710828a9016feb82ebd01e8914b9bb59b4d.tar.xz greatoffice-04153710828a9016feb82ebd01e8914b9bb59b4d.zip | |
feat: remove unused helpers
Diffstat (limited to 'code/app')
| -rw-r--r-- | code/app/src/lib/helpers.ts | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/code/app/src/lib/helpers.ts b/code/app/src/lib/helpers.ts index b659506..4584de7 100644 --- a/code/app/src/lib/helpers.ts +++ b/code/app/src/lib/helpers.ts @@ -1,6 +1,5 @@ import { browser } from "$app/environment"; import type { WorkEntry } from "$lib/models/work/WorkEntry"; -import type { UnwrappedEntryDateTime } from "$lib/models/internal/UnwrappedEntryDateTime"; import { log_info } from "$lib/logger"; import { Temporal } from "temporal-polyfill"; @@ -43,28 +42,6 @@ export function is_norwegian_phone_number(value: string): boolean { return NORWEGIAN_PHONE_NUMBER_REGEX.test(String(value)); } -export function unwrap_date_time_from_entry(entry: WorkEntry): UnwrappedEntryDateTime { - if (!entry) throw new Error("entry was undefined"); - const currentTimeZone = Temporal.Now.timeZone().id; - const startInstant = Temporal.Instant.from(entry.start).toZonedDateTimeISO(currentTimeZone); - const stopInstant = Temporal.Instant.from(entry.stop).toZonedDateTimeISO(currentTimeZone); - - return { - start_date: startInstant.toPlainDate(), - stop_date: stopInstant.toPlainDate(), - start_time: startInstant.toPlainTime(), - stop_time: stopInstant.toPlainTime(), - duration: Temporal.Duration.from({ - hours: stopInstant.hour, - minutes: stopInstant.minute, - }).subtract(Temporal.Duration.from({ - hours: startInstant.hour, - minutes: startInstant.minute, - })), - }; -} - - export function is_guid(value: string): boolean { if (!value) { return false; |
