diff --git a/src/components/WorkerTimeForm.vue b/src/components/WorkerTimeForm.vue new file mode 100644 index 000000000..54462873b --- /dev/null +++ b/src/components/WorkerTimeForm.vue @@ -0,0 +1,106 @@ + + + + + +es: + Add time: AƱadir hora + Edit entry: Editar entrada + Hour: Hora + Type: Tipo + Entrada: Entrada + Intermedio: Intermedio + Salida: Salida + diff --git a/src/components/WorkerTimeHourChip.vue b/src/components/WorkerTimeHourChip.vue index 2dedf1be8..1a6c60eaa 100644 --- a/src/components/WorkerTimeHourChip.vue +++ b/src/components/WorkerTimeHourChip.vue @@ -22,7 +22,7 @@ const $props = defineProps({ }, }); -const emit = defineEmits(['onHourEntryDeleted']); +const emit = defineEmits(['onHourEntryDeleted', 'showWorkerTimeForm']); const { t } = useI18n(); const { notify } = useNotify(); @@ -57,6 +57,16 @@ const deleteHourEntry = async () => { console.error('Error deleting hour entry'); } }; + +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'); @@ -550,9 +555,6 @@ onMounted(async () => { es: - Entrada: Entrada - Intermedio: Intermedio - Salida: Salida Hours: Horas Total semana: Total semana Termina a las: Termina a las