add function formatted date/time to API in mixin
This commit is contained in:
parent
197b621436
commit
126fbdbed1
2 changed files with 20 additions and 7 deletions
|
|
@ -1,7 +1,6 @@
|
|||
<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";
|
||||
|
|
@ -25,6 +24,7 @@ const {
|
|||
showLoader,
|
||||
hideLoader,
|
||||
success,
|
||||
convertDateToAPI,
|
||||
} = mixin;
|
||||
|
||||
const emit = defineEmits(["update:change-page"]);
|
||||
|
|
@ -113,12 +113,7 @@ function onSubmit() {
|
|||
|
||||
/** Function เปลี่ยนรอบเวลา*/
|
||||
async function changeRound() {
|
||||
const formattedDateForAPI = await (formData.effectiveDate
|
||||
? format(
|
||||
utcToZonedTime(formData.effectiveDate, "Asia/Bangkok"),
|
||||
"yyyy-MM-dd"
|
||||
)
|
||||
: null);
|
||||
const formattedDateForAPI = await convertDateToAPI(formData.effectiveDate);
|
||||
|
||||
showLoader();
|
||||
await http
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue