From c885ecfffadc2139cf0a7c0b2fd08444ae9d1407 Mon Sep 17 00:00:00 2001 From: oat_dev Date: Mon, 1 Apr 2024 09:55:50 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B8=97=E0=B8=B0=E0=B9=80=E0=B8=9A=E0=B8=B5?= =?UTF-8?q?=E0=B8=A2=E0=B8=99=E0=B8=9B=E0=B8=A3=E0=B8=B0=E0=B8=A7=E0=B8=B1?= =?UTF-8?q?=E0=B8=95=E0=B8=B4:=20=E0=B9=81=E0=B8=81=E0=B9=89=E0=B8=A7?= =?UTF-8?q?=E0=B8=B1=E0=B8=99=E0=B9=80=E0=B8=94=E0=B8=B7=E0=B8=AD=E0=B8=99?= =?UTF-8?q?=E0=B8=9B=E0=B8=B5=E0=B9=80=E0=B8=81=E0=B8=B4=E0=B8=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/04_registryNew/components/DialogAddData.vue | 9 ++++++++- .../components/detail/PersonalInformation/01_Profile.vue | 8 ++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/modules/04_registryNew/components/DialogAddData.vue b/src/modules/04_registryNew/components/DialogAddData.vue index 44b9f34ab..0ddfae294 100644 --- a/src/modules/04_registryNew/components/DialogAddData.vue +++ b/src/modules/04_registryNew/components/DialogAddData.vue @@ -119,6 +119,12 @@ function closeDialog() { clearFormData(); } +const calculateMaxDate = () => { + const today = new Date(); + today.setFullYear(today.getFullYear() - 18); + return today; +}; + function clearFormData() { formData.prefix = ""; formData.firstName = ""; @@ -195,7 +201,6 @@ watch( hide-bottom-space :rules="[ (val) => { - console.log(val); return val.length > 0 || 'กรุณาเลือกคำนำหน้าชื่อ'; }, ]" @@ -265,6 +270,8 @@ watch( autoApply borderless week-start="0" + :max-date="calculateMaxDate()" + :enableTimePicker="false" menu-class-name="modalfix" v-model="formData.birthDate" :locale="'th'" diff --git a/src/modules/04_registryNew/components/detail/PersonalInformation/01_Profile.vue b/src/modules/04_registryNew/components/detail/PersonalInformation/01_Profile.vue index 8c2b3b577..952c8a71e 100644 --- a/src/modules/04_registryNew/components/detail/PersonalInformation/01_Profile.vue +++ b/src/modules/04_registryNew/components/detail/PersonalInformation/01_Profile.vue @@ -267,6 +267,12 @@ async function getData() { }); } +const calculateMaxDate = () => { + const today = new Date(); + today.setFullYear(today.getFullYear() - 18); + return today; +}; + async function editData() { showLoader(); await http @@ -550,7 +556,9 @@ onMounted(async () => {