From f1faf1852369d4089cc15264bddadee1ebe4c263 Mon Sep 17 00:00:00 2001 From: wbuezas Date: Fri, 22 Mar 2024 14:10:00 -0300 Subject: [PATCH] General improvements --- src/components/WorkerTimeForm.vue | 1 - src/components/WorkerTimeHourChip.vue | 15 ++------ src/filters/date.js | 2 +- src/pages/Worker/Card/WorkerTimeControl.vue | 41 +++++++++------------ src/stores/useWeekdayStore.js | 28 ++++++++++++-- 5 files changed, 46 insertions(+), 41 deletions(-) diff --git a/src/components/WorkerTimeForm.vue b/src/components/WorkerTimeForm.vue index 54462873b..5a70108f5 100644 --- a/src/components/WorkerTimeForm.vue +++ b/src/components/WorkerTimeForm.vue @@ -89,7 +89,6 @@ onBeforeMount(() => { hide-selected :required="true" /> -
{{ workerHourEntry }}
diff --git a/src/components/WorkerTimeHourChip.vue b/src/components/WorkerTimeHourChip.vue index 1a6c60eaa..a2f516098 100644 --- a/src/components/WorkerTimeHourChip.vue +++ b/src/components/WorkerTimeHourChip.vue @@ -4,6 +4,7 @@ import { computed } from 'vue'; import useNotify from 'src/composables/useNotify.js'; import { useVnConfirm } from 'composables/useVnConfirm'; +import { toTimeFormat } from 'filters/date.js'; import axios from 'axios'; const $props = defineProps({ @@ -58,14 +59,6 @@ const deleteHourEntry = async () => { } }; -const getChipFormattedHour = (date) => { - //TODO:: Ver si se puede hacer una funcion reutilizable o complementar a utils de dates - const newDate = new Date(date); - const hour = newDate.getHours(); - const min = newDate.getMinutes(); - return `${hour < 10 ? '0' + hour : hour}:${min < 10 ? '0' + min : min}`; -}; - const showWorkerTimeForm = () => emit('showWorkerTimeForm'); @@ -79,7 +72,7 @@ const showWorkerTimeForm = () => emit('showWorkerTimeForm'); {{ t('Edit') }} {{ - getChipFormattedHour(hour) + toTimeFormat(hour) }} emit('showWorkerTimeForm');