diff --git a/src/components/TimeEntry.vue b/src/components/TimeEntry.vue
index 4445e33..8ac4044 100644
--- a/src/components/TimeEntry.vue
+++ b/src/components/TimeEntry.vue
@@ -63,7 +63,7 @@
@@ -241,7 +241,7 @@ const computedDate = computed(() => {
const computedDuration = computed({
get() {
- const date = !model.value.is_live_clocking ? computedDate.value : new Date().toLocaleDateString('en-CA');
+ const date = !model.value.is_live_clocking ? computedDate.value : $moment().format('YYYY-MM-DD');
const start = $moment(computedDate.value + ' ' + model.value.start_time, 'YYYY-M-D HH:mm');
const end = (model.value.end_time !== '00:00' ? $moment(date) : $moment(date).add(1, 'day')).set({
hours: parseInt(model.value.end_time.split(':')[0]),
@@ -321,8 +321,6 @@ const has_gap = computed(() => {
.duration($moment(model.value.start_time, 'HH:mm').diff($moment(previousEntry.value.end_time, 'HH:mm')))
.format('HH:mm', { trim: false });
return hasGap ? gapDuration : false;
-
- return;
}
return false;
});
@@ -336,7 +334,7 @@ const end_time_error = computed(() => {
});
const duration_error = computed(() => {
- const date = !model.value.is_live_clocking ? computedDate.value : new Date().toLocaleDateString('en-CA');
+ const date = !model.value.is_live_clocking ? computedDate.value : $moment().format('YYYY-MM-DD');
const start = $moment(computedDate.value + ' ' + model.value.start_time, 'YYYY-M-D HH:mm');
const end = (model.value.end_time !== '00:00' ? $moment(date) : $moment(date).add(1, 'day')).set({
hours: parseInt(model.value.end_time.split(':')[0]),
diff --git a/src/stores/index.ts b/src/stores/index.ts
index 6d30415..81190f6 100644
--- a/src/stores/index.ts
+++ b/src/stores/index.ts
@@ -37,7 +37,7 @@ export const useIndexStore = defineStore('store', () => {
},
};
- const selectedDay = ref(new Date().toLocaleDateString('en-CA'));
+ const selectedDay = ref($moment().format('YYYY-MM-DD'));
const filter = useLocalStorage('filter', ref('daily'));
const selectedTabIndex = useLocalStorage('selectedTabIndex', ref(0));
const sort = useLocalStorage('sort', ref('name'));