From a10c60e4a808d93e131bb64e1dc027b5f3c3e4d3 Mon Sep 17 00:00:00 2001 From: SamuelSlavik Date: Mon, 4 Mar 2024 23:51:03 +0100 Subject: [PATCH 1/4] Converted 12hour system into 24 hour system Fixed time parsing functions (recommended also change database timezone) Changed time inputs --- .../components/tracking/timeTrackerLine.vue | 55 +++++++++++++++++- .../components/tracking/timeTrackingItem.vue | 56 +++++++++++++++++-- 2 files changed, 105 insertions(+), 6 deletions(-) diff --git a/frontend/src/components/tracking/timeTrackerLine.vue b/frontend/src/components/tracking/timeTrackerLine.vue index b4220fb..a30be64 100644 --- a/frontend/src/components/tracking/timeTrackerLine.vue +++ b/frontend/src/components/tracking/timeTrackerLine.vue @@ -5,14 +5,65 @@ label="Date" type="date" class="q-ma-sm" :readonly="timerRunning" /> + + + + + + + + + + + + + + { }) const timeFrom = computed(() => { - const date = new Date(props.timeEntry.start_time) - return date.toISOString().substr(11, 5) -}) + const date = new Date(props.timeEntry.start_time); + const options = { timeZone: 'Europe/Prague', hour12: false, hour: '2-digit', minute: '2-digit' }; + return date.toLocaleString('en-US', options); +}); const timeTo = computed(() => { const date = new Date(props.timeEntry.end_time) - return date.toISOString().substr(11, 5) + const options = { timeZone: 'Europe/Prague', hour12: false, hour: '2-digit', minute: '2-digit' }; + return date.toLocaleString('en-US', options); }) const duration = computed(() => { From a5f7c71f108b88064de456bc9b601910dd91202d Mon Sep 17 00:00:00 2001 From: SamuelSlavik Date: Tue, 5 Mar 2024 14:53:59 +0100 Subject: [PATCH 2/4] Add readonly flag to time inputs --- frontend/src/components/tracking/timeTrackingItem.vue | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/frontend/src/components/tracking/timeTrackingItem.vue b/frontend/src/components/tracking/timeTrackingItem.vue index b567a42..a4873cd 100644 --- a/frontend/src/components/tracking/timeTrackingItem.vue +++ b/frontend/src/components/tracking/timeTrackingItem.vue @@ -11,6 +11,7 @@ :rules="['time']" class="q-ma-sm" label="From" + readonly >