convertDatetime
This commit is contained in:
parent
a58bea37c9
commit
9103532fed
1 changed files with 5 additions and 5 deletions
|
|
@ -19,6 +19,8 @@ const {
|
|||
showLoader,
|
||||
hideLoader,
|
||||
messageError,
|
||||
convertDateToAPI,
|
||||
convertDatetimeToAPI,
|
||||
} = useCounterMixin()
|
||||
|
||||
/**
|
||||
|
|
@ -43,7 +45,7 @@ const props = defineProps({
|
|||
})
|
||||
|
||||
const dataByIdVal = ref<DataCheckIn>() //ข้อมูลประวัติการลงเวลา
|
||||
const date = ref<Date | string>(new Date()) //วันที่ข้อแก้ไข
|
||||
const date = ref<Date | string | null>(new Date()) //วันที่ข้อแก้ไข
|
||||
const checkboxIn = ref<boolean>(false) //ขอแก้ไขเวลาเข้างาน
|
||||
const checkboxOut = ref<boolean>(false) //ขอแก้ไขเวลาออกงาน
|
||||
const reason = ref<string>('') // เหตุผล
|
||||
|
|
@ -92,7 +94,7 @@ function onCkickSave() {
|
|||
) {
|
||||
dialogConfirm($q, async () => {
|
||||
const data: FormTimeStemp = {
|
||||
checkDate: date.value,
|
||||
checkDate: convertDatetimeToAPI(date.value as Date),
|
||||
checkInEdit: checkboxIn.value,
|
||||
checkOutEdit: checkboxOut.value,
|
||||
description: reason.value,
|
||||
|
|
@ -149,9 +151,7 @@ onMounted(() => {
|
|||
if (dataByIdVal.value == null) {
|
||||
statusAction.value = true
|
||||
} else {
|
||||
date.value = moment(new Date(dataByIdVal.value.checkInDateTime)).format(
|
||||
'YYYY-MM-DD'
|
||||
)
|
||||
date.value = convertDatetimeToAPI(new Date(dataByIdVal.value.checkInDateTime))
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue