แก้timezone

This commit is contained in:
setthawutttty 2025-03-10 17:09:45 +07:00
parent a4584b979f
commit dbff789a0b
12 changed files with 60 additions and 25 deletions

View file

@ -1,6 +1,7 @@
<script setup lang="ts">
import { ref, reactive, onMounted, computed, watch } from "vue";
import { useQuasar } from "quasar";
import { format, utcToZonedTime } from "date-fns-tz";
import http from "@/plugins/http";
import config from "@/app.config";
@ -132,8 +133,8 @@ async function fetchCheck() {
await http
.post(config.API.leaveCheck(), {
type: dataStore.typeId ?? null,
StartLeaveDate: formDataBirth.leaveStartDate ?? null,
EndLeaveDate: formDataBirth.leaveEndDate ?? null,
StartLeaveDate: format(utcToZonedTime(formDataBirth.leaveStartDate , "Asia/Bangkok"),"yyyy-MM-dd") ?? null,
EndLeaveDate: format(utcToZonedTime(formDataBirth.leaveEndDate , "Asia/Bangkok"),"yyyy-MM-dd") ?? null,
})
.then((res: any) => {
const data = res.data.result;