Compare commits

..

No commits in common. "7ba7bb3e21b913ed3095ec2c8d25ab16a7175e43" and "c7aff2a1f56bb20f4c2c4d9c3a1ba5e4ae8bb259" have entirely different histories.

2 changed files with 21 additions and 43 deletions

View file

@ -79,10 +79,10 @@ const durationYear = ref<number>(0);
const other = ref<string>();
const fundName = ref<string>();
const finishDate = ref<Date>(new Date());
const startDate = ref<number | null>(new Date().getFullYear());
const startDate2 = ref<Date | null>(new Date());
const endDate = ref<number | null>(new Date().getFullYear());
const endDate2 = ref<Date | null>(new Date());
const startDate = ref<number>(new Date().getFullYear());
const startDate2 = ref<Date>(new Date());
const endDate = ref<number>(new Date().getFullYear());
const endDate2 = ref<Date>(new Date());
const minDate = ref<Date>();
const myForm = ref<any>(); //form data input
const edit = ref<boolean>(false); // dialog
@ -451,20 +451,12 @@ const saveData = async () => {
finishDate: convertDateToAPI(finishDate.value),
startDate:
isDate.value == "true"
? startDate2.value
? convertDateToAPI(new Date(startDate2.value))
: null
: startDate.value
? convertDateToAPI(new Date(`${startDate.value}-01-01`))
: null,
? convertDateToAPI(new Date(startDate2.value))
: convertDateToAPI(new Date(`${startDate.value}-01-01`)),
endDate:
isDate.value == "true"
? endDate2.value
? convertDateToAPI(new Date(endDate2.value))
: null
: endDate.value
? convertDateToAPI(new Date(`${endDate.value}-01-01`))
: null,
? convertDateToAPI(new Date(endDate2.value))
: convertDateToAPI(new Date(`${endDate.value}-01-01`)),
isDate: isDate.value == "true",
})
.then(async () => {
@ -507,20 +499,12 @@ const editData = async () => {
finishDate: new Date(finishDate.value),
startDate:
isDate.value == "true"
? startDate2.value
? convertDateToAPI(new Date(startDate2.value))
: null
: startDate.value
? convertDateToAPI(new Date(`${startDate.value}-01-01`))
: null,
? convertDateToAPI(new Date(startDate2.value))
: convertDateToAPI(new Date(`${startDate.value}-01-01`)),
endDate:
isDate.value == "true"
? endDate2.value
? convertDateToAPI(new Date(endDate2.value))
: null
: endDate.value
? convertDateToAPI(new Date(`${endDate.value}-01-01`))
: null,
? convertDateToAPI(new Date(endDate2.value))
: convertDateToAPI(new Date(`${endDate.value}-01-01`)),
isDate: isDate.value == "true",
})
.then(async () => {
@ -610,16 +594,10 @@ const selectData = async (_props: DataProps) => {
other.value = _props.row.other;
fundName.value = _props.row.fundName;
finishDate.value = _props.row.finishDate;
startDate.value = _props.row.startDate
? new Date(_props.row.startDate).getFullYear()
: null;
endDate.value = _props.row.endDate
? new Date(_props.row.endDate).getFullYear()
: null;
startDate2.value = _props.row.startDate
? new Date(_props.row.startDate)
: null;
endDate2.value = _props.row.endDate ? new Date(_props.row.endDate) : null;
startDate.value = new Date(_props.row.startDate).getFullYear();
endDate.value = new Date(_props.row.endDate).getFullYear();
startDate2.value = new Date(_props.row.startDate);
endDate2.value = new Date(_props.row.endDate);
id.value = _props.row.id;
isDate.value = _props.row.isDate;
isEducation.value = _props.row.isEducation;
@ -800,7 +778,7 @@ onMounted(async () => {
@submit.prevent
@validation-success="clickSave"
>
<DialogHeader tittle="ประวัติการศึกษา" :close="clickClose" />
<DialogHeader tittle="ปรqweqwะวัติการศึกษา" :close="clickClose" />
<q-separator />
<q-card-section class="q-p-sm">
<div class="row col-12 items-top q-col-gutter-x-xs q-col-gutter-y-xs">
@ -890,7 +868,7 @@ onMounted(async () => {
:outlined="edit"
dense
:borderless="!edit"
:model-value="startDate ? startDate + 543 : ''"
:model-value="startDate + 543"
:rules="[
(val:string) =>
!!val || `${'กรุณาเลือกปีที่เริ่มต้นศึกษา'}`,
@ -983,7 +961,7 @@ onMounted(async () => {
:outlined="edit"
dense
:borderless="!edit"
:model-value="endDate ? endDate + 543 : ''"
:model-value="endDate + 543"
:rules="[
(val:string) => !!val || `${'กรุณาเลือกปีที่จบการศึกษา'}`,
]"

View file

@ -22,8 +22,8 @@ interface RequestItemsObject {
other: string;
fundName: string;
finishDate: Date;
startDate: number | null;
endDate: number | null;
startDate: number;
endDate: number;
createdFullName: string;
createdAt: Date;
isDate: string;