aboutsummaryrefslogtreecommitdiffstats
path: root/code/app/src/lib/helpers.ts
diff options
context:
space:
mode:
authorivarlovlie <git@ivarlovlie.no>2022-11-14 03:23:46 +0100
committerivarlovlie <git@ivarlovlie.no>2022-11-14 03:23:46 +0100
commit04153710828a9016feb82ebd01e8914b9bb59b4d (patch)
treef4d75b8fc6285bf601c0ce18fa55d480e25c6197 /code/app/src/lib/helpers.ts
parent04315a5555e8796f4459524421a8daf4f83ddfc1 (diff)
downloadgreatoffice-04153710828a9016feb82ebd01e8914b9bb59b4d.tar.xz
greatoffice-04153710828a9016feb82ebd01e8914b9bb59b4d.zip
feat: remove unused helpers
Diffstat (limited to 'code/app/src/lib/helpers.ts')
-rw-r--r--code/app/src/lib/helpers.ts23
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;