diff --git a/src/stores/mixin.ts b/src/stores/mixin.ts index 41c7161..b23252e 100644 --- a/src/stores/mixin.ts +++ b/src/stores/mixin.ts @@ -14,7 +14,7 @@ export const useCounterMixin = defineStore("mixin", () => { const calAge = ( srcDate: Date, birthCal: Date = new Date(), - eng: boolean = false + eng: boolean = false, ) => { const year = eng ? "years" : "ปี"; const month = eng ? "months" : "เดือน"; @@ -82,7 +82,7 @@ export const useCounterMixin = defineStore("mixin", () => { function date2Thai( srcDate: Date | null, isFullMonth: boolean = false, - isTime: boolean = false + isTime: boolean = false, ) { if (srcDate == null || !moment(srcDate).isValid()) return ""; @@ -98,7 +98,7 @@ export const useCounterMixin = defineStore("mixin", () => { function dateThai( srcDate: Date, isFullMonth: boolean = true, - isTime: boolean = false + isTime: boolean = false, ) { if (srcDate == null) { return null; @@ -490,7 +490,7 @@ export const useCounterMixin = defineStore("mixin", () => { color: string | undefined, ok?: Function | undefined, cancel?: Function | undefined, - onlycancel: Boolean = false + onlycancel: Boolean = false, ) => { q.dialog({ component: CustomComponent, @@ -529,7 +529,7 @@ export const useCounterMixin = defineStore("mixin", () => { title: string, message: string, ok: Function, - cancel?: Function + cancel?: Function, ) { q.dialog({ title: `${title}`, @@ -559,7 +559,7 @@ export const useCounterMixin = defineStore("mixin", () => { title: string, message: string, ok: Function, - cancel?: Function + cancel?: Function, ) { q.dialog({ title: `${title}`, @@ -795,7 +795,7 @@ export const useCounterMixin = defineStore("mixin", () => { ok?: Function, title?: string, // ถ้ามี cancel action ใส่เป็น null desc?: string, // ถ้ามี cancel action ใส่เป็น null - cancel?: Function + cancel?: Function, ) => { q.dialog({ component: CustomComponent, @@ -824,7 +824,7 @@ export const useCounterMixin = defineStore("mixin", () => { ok?: Function, title?: string, // ถ้ามี cancel action ใส่เป็น null desc?: string, // ถ้ามี cancel action ใส่เป็น null - cancel?: Function + cancel?: Function, ) => { q.dialog({ component: CustomComponent, @@ -851,7 +851,7 @@ export const useCounterMixin = defineStore("mixin", () => { const dialogMessageNotify = ( q: any, desc?: string, // ถ้ามี cancel action ใส่เป็น null - cancel?: Function + cancel?: Function, ) => { q.dialog({ component: CustomComponent, @@ -973,7 +973,7 @@ export const useCounterMixin = defineStore("mixin", () => { * @returns ผลการคำนวน ปี เดือน วัน ในรูปแบบ 1 ปี 10 เดือน 5 วัน */ function calculateDurationYmd(startDate: any, endDate: any) { - if (!startDate || !endDate) return ""; + if (!startDate || !endDate) return ""; let start = moment(startDate).startOf("day"); let end = moment(endDate).startOf("day").add(1, "day"); @@ -1252,9 +1252,7 @@ export const useCounterMixin = defineStore("mixin", () => { // กรณีมีเฉพาะ date function convertDateToAPI(date: Date | null) { - return date - ? format(utcToZonedTime(date, "Asia/Bangkok"), "yyyy-MM-dd") - : null; + return date ? format(date, "yyyy-MM-dd") : null; } // กรณี datetime