แก้timezone
This commit is contained in:
parent
a4584b979f
commit
dbff789a0b
12 changed files with 60 additions and 25 deletions
|
|
@ -1,6 +1,7 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, reactive, watch, computed, onMounted } from "vue";
|
import { ref, reactive, watch, computed, onMounted } from "vue";
|
||||||
import { useQuasar } from "quasar";
|
import { useQuasar } from "quasar";
|
||||||
|
import { format, utcToZonedTime } from "date-fns-tz";
|
||||||
|
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
|
|
@ -150,8 +151,16 @@ async function fetchCheck() {
|
||||||
await http
|
await http
|
||||||
.post(config.API.leaveCheck(), {
|
.post(config.API.leaveCheck(), {
|
||||||
type: dataStore.typeId ?? null,
|
type: dataStore.typeId ?? null,
|
||||||
StartLeaveDate: formDataSick.leaveStartDate ?? null,
|
StartLeaveDate:
|
||||||
EndLeaveDate: formDataSick.leaveEndDate ?? null,
|
format(
|
||||||
|
utcToZonedTime(formDataSick.leaveStartDate, "Asia/Bangkok"),
|
||||||
|
"yyyy-MM-dd"
|
||||||
|
) ?? null,
|
||||||
|
EndLeaveDate:
|
||||||
|
format(
|
||||||
|
utcToZonedTime(formDataSick.leaveEndDate, "Asia/Bangkok"),
|
||||||
|
"yyyy-MM-dd"
|
||||||
|
) ?? null,
|
||||||
})
|
})
|
||||||
.then((res: any) => {
|
.then((res: any) => {
|
||||||
const data = res.data.result;
|
const data = res.data.result;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, reactive, onMounted, computed, watch } from "vue";
|
import { ref, reactive, onMounted, computed, watch } from "vue";
|
||||||
import { useQuasar } from "quasar";
|
import { useQuasar } from "quasar";
|
||||||
|
import { format, utcToZonedTime } from "date-fns-tz";
|
||||||
|
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
|
|
@ -132,8 +133,8 @@ async function fetchCheck() {
|
||||||
await http
|
await http
|
||||||
.post(config.API.leaveCheck(), {
|
.post(config.API.leaveCheck(), {
|
||||||
type: dataStore.typeId ?? null,
|
type: dataStore.typeId ?? null,
|
||||||
StartLeaveDate: formDataBirth.leaveStartDate ?? null,
|
StartLeaveDate: format(utcToZonedTime(formDataBirth.leaveStartDate , "Asia/Bangkok"),"yyyy-MM-dd") ?? null,
|
||||||
EndLeaveDate: formDataBirth.leaveEndDate ?? null,
|
EndLeaveDate: format(utcToZonedTime(formDataBirth.leaveEndDate , "Asia/Bangkok"),"yyyy-MM-dd") ?? null,
|
||||||
})
|
})
|
||||||
.then((res: any) => {
|
.then((res: any) => {
|
||||||
const data = res.data.result;
|
const data = res.data.result;
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
import { ref, reactive, onMounted, computed, watch } from "vue";
|
import { ref, reactive, onMounted, computed, watch } from "vue";
|
||||||
import { useQuasar } from "quasar";
|
import { useQuasar } from "quasar";
|
||||||
import { useRouter } from "vue-router";
|
import { useRouter } from "vue-router";
|
||||||
|
import { format, utcToZonedTime } from "date-fns-tz";
|
||||||
|
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
|
|
@ -159,8 +160,8 @@ async function fetchCheck() {
|
||||||
await http
|
await http
|
||||||
.post(config.API.leaveCheck(), {
|
.post(config.API.leaveCheck(), {
|
||||||
type: dataStore.typeId ?? null,
|
type: dataStore.typeId ?? null,
|
||||||
StartLeaveDate: formDataHelpWife.leaveStartDate ?? null,
|
StartLeaveDate: format(utcToZonedTime( formDataHelpWife.leaveStartDate, "Asia/Bangkok"),"yyyy-MM-dd") ?? null,
|
||||||
EndLeaveDate: formDataHelpWife.leaveEndDate ?? null,
|
EndLeaveDate: format(utcToZonedTime( formDataHelpWife.leaveEndDate, "Asia/Bangkok"),"yyyy-MM-dd") ?? null,
|
||||||
})
|
})
|
||||||
.then((res: any) => {
|
.then((res: any) => {
|
||||||
const data = res.data.result;
|
const data = res.data.result;
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
import { ref, reactive, onMounted, computed, watch } from "vue";
|
import { ref, reactive, onMounted, computed, watch } from "vue";
|
||||||
import { useQuasar } from "quasar";
|
import { useQuasar } from "quasar";
|
||||||
import { useRouter } from "vue-router";
|
import { useRouter } from "vue-router";
|
||||||
|
import { format, utcToZonedTime } from "date-fns-tz";
|
||||||
|
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
|
|
@ -164,8 +165,16 @@ async function fetchCheck() {
|
||||||
await http
|
await http
|
||||||
.post(config.API.leaveCheck(), {
|
.post(config.API.leaveCheck(), {
|
||||||
type: dataStore.typeId ?? null,
|
type: dataStore.typeId ?? null,
|
||||||
StartLeaveDate: formDataVacation.leaveStartDate ?? null,
|
StartLeaveDate:
|
||||||
EndLeaveDate: formDataVacation.leaveEndDate ?? null,
|
format(
|
||||||
|
utcToZonedTime(formDataVacation.leaveStartDate, "Asia/Bangkok"),
|
||||||
|
"yyyy-MM-dd"
|
||||||
|
) ?? null,
|
||||||
|
EndLeaveDate:
|
||||||
|
format(
|
||||||
|
utcToZonedTime(formDataVacation.leaveEndDate, "Asia/Bangkok"),
|
||||||
|
"yyyy-MM-dd"
|
||||||
|
) ?? null,
|
||||||
})
|
})
|
||||||
.then((res: any) => {
|
.then((res: any) => {
|
||||||
const data = res.data.result;
|
const data = res.data.result;
|
||||||
|
|
@ -350,7 +359,6 @@ onMounted(() => {
|
||||||
</q-input>
|
</q-input>
|
||||||
</template>
|
</template>
|
||||||
</datepicker>
|
</datepicker>
|
||||||
|
|
||||||
<datepicker
|
<datepicker
|
||||||
class="col-12 col-md-3 col-sm-6 cursor-pointer inputgreen"
|
class="col-12 col-md-3 col-sm-6 cursor-pointer inputgreen"
|
||||||
menu-class-name="modalfix"
|
menu-class-name="modalfix"
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { reactive, ref, onMounted, computed, watch } from "vue";
|
import { reactive, ref, onMounted, computed, watch } from "vue";
|
||||||
import { useQuasar } from "quasar";
|
import { useQuasar } from "quasar";
|
||||||
|
import { format, utcToZonedTime } from "date-fns-tz";
|
||||||
|
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
|
|
@ -170,8 +171,8 @@ async function fetchCheck() {
|
||||||
await http
|
await http
|
||||||
.post(config.API.leaveCheck(), {
|
.post(config.API.leaveCheck(), {
|
||||||
type: dataStore.typeId ?? null,
|
type: dataStore.typeId ?? null,
|
||||||
StartLeaveDate: formDataOrdination.leaveStartDate ?? null,
|
StartLeaveDate: format(utcToZonedTime( formDataOrdination.leaveStartDate, "Asia/Bangkok"),"yyyy-MM-dd") ?? null,
|
||||||
EndLeaveDate: formDataOrdination.leaveEndDate ?? null,
|
EndLeaveDate: format(utcToZonedTime( formDataOrdination.leaveEndDate, "Asia/Bangkok"),"yyyy-MM-dd") ?? null,
|
||||||
})
|
})
|
||||||
.then((res: any) => {
|
.then((res: any) => {
|
||||||
const data = res.data.result;
|
const data = res.data.result;
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
import { reactive, ref, onMounted, computed, watch } from "vue";
|
import { reactive, ref, onMounted, computed, watch } from "vue";
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
import { useQuasar } from "quasar";
|
import { useQuasar } from "quasar";
|
||||||
|
import { format, utcToZonedTime } from "date-fns-tz";
|
||||||
|
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
|
|
@ -123,8 +124,8 @@ async function fetchCheck() {
|
||||||
await http
|
await http
|
||||||
.post(config.API.leaveCheck(), {
|
.post(config.API.leaveCheck(), {
|
||||||
type: dataStore.typeId ?? null,
|
type: dataStore.typeId ?? null,
|
||||||
StartLeaveDate: formDataHaji.leaveStartDate ?? null,
|
StartLeaveDate: format(utcToZonedTime( formDataHaji.leaveStartDate, "Asia/Bangkok"),"yyyy-MM-dd") ?? null,
|
||||||
EndLeaveDate: formDataHaji.leaveEndDate ?? null,
|
EndLeaveDate: format(utcToZonedTime( formDataHaji.leaveEndDate, "Asia/Bangkok"),"yyyy-MM-dd") ?? null,
|
||||||
})
|
})
|
||||||
.then((res: any) => {
|
.then((res: any) => {
|
||||||
const data = res.data.result;
|
const data = res.data.result;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { reactive, ref, onMounted, computed, watch } from "vue";
|
import { reactive, ref, onMounted, computed, watch } from "vue";
|
||||||
import { useQuasar } from "quasar";
|
import { useQuasar } from "quasar";
|
||||||
|
import { format, utcToZonedTime } from "date-fns-tz";
|
||||||
|
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
|
|
@ -147,8 +148,8 @@ async function fetchCheck() {
|
||||||
await http
|
await http
|
||||||
.post(config.API.leaveCheck(), {
|
.post(config.API.leaveCheck(), {
|
||||||
type: dataStore.typeId ?? null,
|
type: dataStore.typeId ?? null,
|
||||||
StartLeaveDate: formDataMilitary.leaveStartDate ?? null,
|
StartLeaveDate: format(utcToZonedTime(formDataMilitary.leaveStartDate , "Asia/Bangkok"),"yyyy-MM-dd") ?? null,
|
||||||
EndLeaveDate: formDataMilitary.leaveEndDate ?? null,
|
EndLeaveDate: format(utcToZonedTime(formDataMilitary.leaveEndDate , "Asia/Bangkok"),"yyyy-MM-dd") ?? null,
|
||||||
})
|
})
|
||||||
.then((res: any) => {
|
.then((res: any) => {
|
||||||
const data = res.data.result;
|
const data = res.data.result;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { reactive, ref, computed, onMounted, watch } from "vue";
|
import { reactive, ref, computed, onMounted, watch } from "vue";
|
||||||
import { useQuasar } from "quasar";
|
import { useQuasar } from "quasar";
|
||||||
|
import { format, utcToZonedTime } from "date-fns-tz";
|
||||||
|
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
|
|
@ -167,8 +168,8 @@ async function fetchCheck() {
|
||||||
await http
|
await http
|
||||||
.post(config.API.leaveCheck(), {
|
.post(config.API.leaveCheck(), {
|
||||||
type: dataStore.typeId ?? null,
|
type: dataStore.typeId ?? null,
|
||||||
StartLeaveDate: formDataStudy.leaveStartDate ?? null,
|
StartLeaveDate: format(utcToZonedTime( formDataStudy.leaveStartDate, "Asia/Bangkok"),"yyyy-MM-dd") ?? null,
|
||||||
EndLeaveDate: formDataStudy.leaveEndDate ?? null,
|
EndLeaveDate: format(utcToZonedTime( formDataStudy.leaveEndDate, "Asia/Bangkok"),"yyyy-MM-dd") ?? null,
|
||||||
})
|
})
|
||||||
.then((res: any) => {
|
.then((res: any) => {
|
||||||
const data = res.data.result;
|
const data = res.data.result;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { reactive, ref, computed, onMounted, watch } from "vue";
|
import { reactive, ref, computed, onMounted, watch } from "vue";
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
|
import { format, utcToZonedTime } from "date-fns-tz";
|
||||||
|
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
|
|
@ -154,8 +155,8 @@ async function fetchCheck() {
|
||||||
await http
|
await http
|
||||||
.post(config.API.leaveCheck(), {
|
.post(config.API.leaveCheck(), {
|
||||||
type: dataStore.typeId ?? null,
|
type: dataStore.typeId ?? null,
|
||||||
StartLeaveDate: formDataTrain.leaveStartDate ?? null,
|
StartLeaveDate: format(utcToZonedTime( formDataTrain.leaveStartDate, "Asia/Bangkok"),"yyyy-MM-dd") ?? null,
|
||||||
EndLeaveDate: formDataTrain.leaveEndDate ?? null,
|
EndLeaveDate: format(utcToZonedTime( formDataTrain.leaveEndDate, "Asia/Bangkok"),"yyyy-MM-dd") ?? null,
|
||||||
})
|
})
|
||||||
.then((res: any) => {
|
.then((res: any) => {
|
||||||
const data = res.data.result;
|
const data = res.data.result;
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
import { ref, reactive, watch, onMounted, computed } from "vue";
|
import { ref, reactive, watch, onMounted, computed } from "vue";
|
||||||
import { useRouter } from "vue-router";
|
import { useRouter } from "vue-router";
|
||||||
import { useQuasar } from "quasar";
|
import { useQuasar } from "quasar";
|
||||||
|
import { format, utcToZonedTime } from "date-fns-tz";
|
||||||
|
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
|
|
@ -150,8 +151,8 @@ async function fetchCheck() {
|
||||||
await http
|
await http
|
||||||
.post(config.API.leaveCheck(), {
|
.post(config.API.leaveCheck(), {
|
||||||
type: dataStore.typeId ?? null,
|
type: dataStore.typeId ?? null,
|
||||||
StartLeaveDate: formDataWorkInternational.leaveStartDate ?? null,
|
StartLeaveDate: format(utcToZonedTime( formDataWorkInternational.leaveStartDate, "Asia/Bangkok"),"yyyy-MM-dd") ?? null,
|
||||||
EndLeaveDate: formDataWorkInternational.leaveEndDate ?? null,
|
EndLeaveDate: format(utcToZonedTime( formDataWorkInternational.leaveEndDate, "Asia/Bangkok"),"yyyy-MM-dd") ?? null,
|
||||||
})
|
})
|
||||||
.then((res: any) => {
|
.then((res: any) => {
|
||||||
const data = res.data.result;
|
const data = res.data.result;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, reactive, computed, onMounted, watch } from "vue";
|
import { ref, reactive, computed, onMounted, watch } from "vue";
|
||||||
import { useQuasar } from "quasar";
|
import { useQuasar } from "quasar";
|
||||||
|
import { format, utcToZonedTime } from "date-fns-tz";
|
||||||
|
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
|
|
@ -187,8 +188,8 @@ async function fetchCheck() {
|
||||||
await http
|
await http
|
||||||
.post(config.API.leaveCheck(), {
|
.post(config.API.leaveCheck(), {
|
||||||
type: dataStore.typeId ?? null,
|
type: dataStore.typeId ?? null,
|
||||||
StartLeaveDate: formDataFollowSpouse.leaveStartDate ?? null,
|
StartLeaveDate: format(utcToZonedTime( formDataFollowSpouse.leaveStartDate, "Asia/Bangkok"),"yyyy-MM-dd") ?? null,
|
||||||
EndLeaveDate: formDataFollowSpouse.leaveEndDate ?? null,
|
EndLeaveDate: format(utcToZonedTime( formDataFollowSpouse.leaveEndDate, "Asia/Bangkok"),"yyyy-MM-dd") ?? null,
|
||||||
})
|
})
|
||||||
.then((res: any) => {
|
.then((res: any) => {
|
||||||
const data = res.data.result;
|
const data = res.data.result;
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
import { reactive, ref, onMounted, computed, watch } from "vue";
|
import { reactive, ref, onMounted, computed, watch } from "vue";
|
||||||
import { useQuasar } from "quasar";
|
import { useQuasar } from "quasar";
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
|
import { format, utcToZonedTime } from "date-fns-tz";
|
||||||
|
|
||||||
import type { RehabilitationForm } from "@/modules/05_leave/interface/request/AddAbsence";
|
import type { RehabilitationForm } from "@/modules/05_leave/interface/request/AddAbsence";
|
||||||
import { useLeaveStore } from "@/modules/05_leave/store";
|
import { useLeaveStore } from "@/modules/05_leave/store";
|
||||||
|
|
@ -110,8 +111,16 @@ async function FetchCheck() {
|
||||||
await http
|
await http
|
||||||
.post(config.API.leaveCheck(), {
|
.post(config.API.leaveCheck(), {
|
||||||
type: dataStore.typeId ?? null,
|
type: dataStore.typeId ?? null,
|
||||||
StartLeaveDate: formDataRehabilitation.leaveStartDate ?? null,
|
StartLeaveDate:
|
||||||
EndLeaveDate: formDataRehabilitation.leaveEndDate ?? null,
|
format(
|
||||||
|
utcToZonedTime(formDataRehabilitation.leaveStartDate, "Asia/Bangkok"),
|
||||||
|
"yyyy-MM-dd"
|
||||||
|
) ?? null,
|
||||||
|
EndLeaveDate:
|
||||||
|
format(
|
||||||
|
utcToZonedTime(formDataRehabilitation.leaveEndDate, "Asia/Bangkok"),
|
||||||
|
"yyyy-MM-dd"
|
||||||
|
) ?? null,
|
||||||
})
|
})
|
||||||
.then((res: any) => {
|
.then((res: any) => {
|
||||||
const data = res.data.result;
|
const data = res.data.result;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue