From 04153710828a9016feb82ebd01e8914b9bb59b4d Mon Sep 17 00:00:00 2001 From: ivarlovlie Date: Mon, 14 Nov 2022 09:23:46 +0700 Subject: feat: remove unused helpers --- code/app/src/lib/helpers.ts | 23 ----------------------- 1 file changed, 23 deletions(-) (limited to 'code/app/src/lib') 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; -- cgit v1.3