Merge branch 'develop' into devTee

This commit is contained in:
STW_TTTY\stwtt 2024-04-05 09:26:25 +07:00
commit 9744d00737
2 changed files with 5 additions and 34 deletions

View file

@ -129,7 +129,7 @@ onMounted(() => {
outlined
v-model="formFilter.round"
:options="positionOp"
label="ตำแหน่ง"
label="รอบการประเมิน"
option-label="name"
option-value="id"
emit-value

View file

@ -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<DataOption[]>([]);
const provinceOpMain = ref<DataOption[]>([]);
@ -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 าตวพมพนหา