From e86e98b2f96e91f583e8c3849f06ce0cc12fe8da Mon Sep 17 00:00:00 2001
From: ivarlovlie <git@ivarlovlie.no>
Date: Mon, 13 Jun 2022 21:26:41 +0200
Subject: fix: Convert dateTimes to plainTimes before setting values

---
 .../src/app/pages/views/entry-form/sections/date-time.svelte       | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

(limited to 'apps/projects/src/app/pages/views/entry-form/sections/date-time.svelte')

diff --git a/apps/projects/src/app/pages/views/entry-form/sections/date-time.svelte b/apps/projects/src/app/pages/views/entry-form/sections/date-time.svelte
index 47b06e3..b91f1a4 100644
--- a/apps/projects/src/app/pages/views/entry-form/sections/date-time.svelte
+++ b/apps/projects/src/app/pages/views/entry-form/sections/date-time.svelte
@@ -1,6 +1,6 @@
 <script lang="ts">
     import LL from "$app/lib/i18n/i18n-svelte";
-    import {Temporal} from "@js-temporal/polyfill";
+    import { Temporal } from "@js-temporal/polyfill";
 
     // TIME
     let fromTimeValue = "";
@@ -107,9 +107,8 @@
             console.log($LL.views.entryForm.dateTime._logReset());
         },
         set_times(value) {
-            console.log(value);
-            fromTimeValue = value.from.toString().substring(0, 5);
-            toTimeValue = value.to.toString().substring(0, 5);
+            fromTimeValue = value.from.toPlainTime().toString().substring(0, 5);
+            toTimeValue = value.to.toPlainTime().toString().substring(0, 5);
         },
         set_date(new_date: Temporal.PlainDate) {
             date = new_date.toString();
-- 
cgit v1.3

