diff --git a/src/components/common/VnInputTime.vue b/src/components/common/VnInputTime.vue index a59f0e9e8..7ee93de19 100644 --- a/src/components/common/VnInputTime.vue +++ b/src/components/common/VnInputTime.vue @@ -50,7 +50,7 @@ const formattedTime = computed({ } if (!props.timeOnly) { const [hh, mm] = time.split(':'); - const date = model.value ?? Date.vnNew(); + const date = new Date(model.value ? model.value : null); date.setHours(hh, mm, 0); time = date?.toISOString(); } @@ -62,7 +62,7 @@ const formattedTime = computed({ function dateToTime(newDate) { return date.formatDate(new Date(newDate), dateFormat); } -const timeField = ref(); + watch( () => model.value, (val) => (formattedTime.value = val), @@ -153,4 +153,3 @@ watch( es: Open time: Abrir tiempo -, nextTick