fixing convert time

This commit is contained in:
Warunee Tamkoo 2025-03-19 17:19:09 +07:00
parent 393f65b7ca
commit bd8563445e

View file

@ -20,7 +20,6 @@ const {
hideLoader,
messageError,
convertDateToAPI,
convertDatetimeToAPI,
} = useCounterMixin()
/**
@ -88,6 +87,13 @@ function onCkickSave() {
}
}
}
//
if (props.action === 'special') {
checkboxIn.value = true
checkboxOut.value = true
}
if (checkboxIn.value === false && checkboxOut.value === false) {
checkstatusBox.value = true
}
@ -98,7 +104,7 @@ function onCkickSave() {
) {
dialogConfirm($q, async () => {
const data: FormTimeStemp = {
checkDate: convertDatetimeToAPI(date.value as Date),
checkDate: convertDateToAPI(date.value as Date),
checkInEdit: checkboxIn.value,
checkOutEdit: checkboxOut.value,
description: reason.value,
@ -155,9 +161,7 @@ onMounted(() => {
if (dataByIdVal.value == null) {
statusAction.value = true
} else {
date.value = convertDatetimeToAPI(
new Date(dataByIdVal.value.checkInDateTime)
)
date.value = convertDateToAPI(new Date(dataByIdVal.value.checkInDateTime))
}
})
</script>