From 2073f9ab8c2ec960d775f3ca1ac8363eb46ba349 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Thu, 4 Apr 2024 17:49:12 +0700 Subject: [PATCH 1/2] =?UTF-8?q?=E0=B9=80=E0=B8=9B=E0=B8=A5=E0=B8=B5?= =?UTF-8?q?=E0=B9=88=E0=B8=A2=E0=B8=99=20function=20date?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../15_development/components/Other.vue | 37 ++----------------- 1 file changed, 4 insertions(+), 33 deletions(-) diff --git a/src/modules/15_development/components/Other.vue b/src/modules/15_development/components/Other.vue index 2829f0ff2..26bcd73e9 100644 --- a/src/modules/15_development/components/Other.vue +++ b/src/modules/15_development/components/Other.vue @@ -5,7 +5,6 @@ import { useQuasar } from "quasar"; import http from "@/plugins/http"; import config from "@/app.config"; -import type { FormFollowOther } from "@/modules/15_development/interface/request/Main"; import type { DataOption } from "@/modules/15_development/interface/index/Main"; import { useCounterMixin } from "@/stores/mixin"; @@ -13,13 +12,8 @@ import { useDevelopmentDataStore } from "@/modules/15_development/store/developm const $q = useQuasar(); const store = useDevelopmentDataStore(); -const { - showLoader, - hideLoader, - calculateDurationYmd, - date2Thai, - messageError, -} = useCounterMixin(); +const { showLoader, hideLoader, diffDay, date2Thai, messageError } = + useCounterMixin(); const provinceOp = ref([]); const provinceOpMain = ref([]); @@ -70,7 +64,7 @@ function changeDateStart() { store.formAddProject.dateEnd = null; store.formAddProject.totalDate = null; } else { - daysBetweenDates( + store.formAddProject.totalDate = diffDay( store.formAddProject.dateStart, store.formAddProject.dateEnd ); @@ -79,35 +73,12 @@ function changeDateStart() { } function changeDateEnd() { - daysBetweenDates( + store.formAddProject.totalDate = diffDay( store.formAddProject.dateStart, store.formAddProject.dateEnd ); } -async function daysBetweenDates(date1: any, date2: any) { - const newStartDate = resetTimeToMidnight(new Date(date1)); - const newEndDate = resetTimeToMidnight(new Date(date2)); - - const differenceInMilliseconds = - newEndDate.getTime() - newStartDate.getTime(); - - const differenceInDays = Math.floor( - differenceInMilliseconds / (1000 * 60 * 60 * 24) - ); - - store.formAddProject.totalDate = differenceInDays + 1; -} - -function resetTimeToMidnight(date: Date): Date { - const newDate = new Date(date); - newDate.setHours(0); - newDate.setMinutes(0); - newDate.setSeconds(0); - newDate.setMilliseconds(0); - return newDate; -} - /** * Fuction Filter จังหวัด * @param val ค่าตัวพิมพ์ค้นหา From 7c5cf3794bba1a4e3103a821be3bdfe8ff709501 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Thu, 4 Apr 2024 17:58:08 +0700 Subject: [PATCH 2/2] =?UTF-8?q?=E0=B9=81=E0=B8=81=E0=B9=88=E0=B9=84?= =?UTF-8?q?=E0=B8=82=E0=B8=84=E0=B8=B3=E0=B8=9C=E0=B8=B7=E0=B8=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/14_KPI/views/indicatorByRole.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/14_KPI/views/indicatorByRole.vue b/src/modules/14_KPI/views/indicatorByRole.vue index 5e1b03dbb..5e5878e30 100644 --- a/src/modules/14_KPI/views/indicatorByRole.vue +++ b/src/modules/14_KPI/views/indicatorByRole.vue @@ -129,7 +129,7 @@ onMounted(() => { outlined v-model="formFilter.round" :options="positionOp" - label="ตำแหน่ง" + label="รอบการประเมิน" option-label="name" option-value="id" emit-value