From 243a8cbdc69f7d3c83e8af64088503d99104b410 Mon Sep 17 00:00:00 2001 From: Jon Date: Mon, 15 Jul 2024 12:42:14 +0200 Subject: [PATCH] fix: refs #7323 fix workerTimeControl form --- src/components/common/VnInputTime.vue | 2 +- src/pages/Worker/Card/WorkerTimeControl.vue | 1 - .../Worker/Card/WorkerTimeControlCalendar.vue | 17 ----------------- src/pages/Worker/Card/WorkerTimeForm.vue | 2 -- 4 files changed, 1 insertion(+), 21 deletions(-) diff --git a/src/components/common/VnInputTime.vue b/src/components/common/VnInputTime.vue index e10838672..9475426ea 100644 --- a/src/components/common/VnInputTime.vue +++ b/src/components/common/VnInputTime.vue @@ -44,7 +44,7 @@ const formattedTime = computed({ if (time?.length > 5) time = dateToTime(time); if (!props.timeOnly) { const hours = time.split(':'); - const date = Date.vnNew(); + const date = model.value ?? Date.vnNew(); date.setHours(hours[0], hours[1], 0); time = date.toISOString(); } diff --git a/src/pages/Worker/Card/WorkerTimeControl.vue b/src/pages/Worker/Card/WorkerTimeControl.vue index c11dd4522..172e3570a 100644 --- a/src/pages/Worker/Card/WorkerTimeControl.vue +++ b/src/pages/Worker/Card/WorkerTimeControl.vue @@ -575,7 +575,6 @@ onMounted(async () => { {{ secondsToHoursMinutes(day.dayData?.workedHours) }} - {{ day.dayData?.dated }} { } } }; - -// const w = computed(() => { -// const spanishWeekdays = ['L', 'M', 'X', 'J', 'V', 'S', 'D']; -// const englishWeekdays = [1, 2, 3, 4, 5, 6, 0]; - -// if (locale.value === 'es') return spanishWeekdays; -// return englishWeekdays; -// // return locale.value === 'en' -// // ? englishWeekdays -// // : spanishWeekdays.map((day) => (day === 3 ? 'X' : day.toString())); -// }); -// const weekdays = computed(() => { -// return locale.value === 'es' -// ? console.log([1, 2, 3, 4, 5, 6, 0]) //{ 1: 'L', 2: 'M', 3: 'X', 4: 'J', 5: 'V', 6: 'S', 0: 'D' } -// : [1, 2, 3, 4, 5, 6, 0]; -// });