fixing set round checkin
This commit is contained in:
parent
d93063d291
commit
500168697b
1 changed files with 11 additions and 2 deletions
|
|
@ -1,6 +1,7 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, reactive, watch, onMounted } from "vue";
|
||||
import { useQuasar } from "quasar";
|
||||
import { format, utcToZonedTime } from "date-fns-tz";
|
||||
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
|
@ -112,12 +113,19 @@ function onSubmit() {
|
|||
|
||||
/** Function เปลี่ยนรอบเวลา*/
|
||||
async function changeRound() {
|
||||
const formattedDateForAPI = await (formData.effectiveDate
|
||||
? format(
|
||||
utcToZonedTime(formData.effectiveDate, "Asia/Bangkok"),
|
||||
"yyyy-MM-dd"
|
||||
)
|
||||
: null);
|
||||
|
||||
showLoader();
|
||||
await http
|
||||
.post(config.API.leaveRound(), {
|
||||
profileId: props.personId,
|
||||
roundId: formData.round,
|
||||
effectiveDate: formData.effectiveDate,
|
||||
effectiveDate: formattedDateForAPI,
|
||||
remark: formData.reson,
|
||||
})
|
||||
.then(() => {
|
||||
|
|
@ -278,10 +286,11 @@ watch(
|
|||
class="inputgreen"
|
||||
menu-class-name="modalfix"
|
||||
v-model="formData.effectiveDate"
|
||||
:timezone="'Asia/Bangkok'"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
borderless
|
||||
:enableTimePicker="false"
|
||||
:enable-time-picker="false"
|
||||
week-start="0"
|
||||
:min-date="
|
||||
dataToday
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue