diff --git a/src/components/common/VnInputTime.vue b/src/components/common/VnInputTime.vue index 0971facf9..31ac7c04f 100644 --- a/src/components/common/VnInputTime.vue +++ b/src/components/common/VnInputTime.vue @@ -49,9 +49,9 @@ const formattedTime = computed({ time = time.substring(0, 2) + ':' + time.substring(3, 5); } if (!props.timeOnly) { - const hours = time.split(':'); + const [hh, mm] = time.split(':'); const date = new Date(model.value ? model.value : null); - date.setHours(hours[0] ?? 0, hours[1] ?? 0, 0); + date.setHours(hh, mm, 0); time = date?.toISOString(); } }