From b6dd0417a42f50a65ac8ad6d579fdcfad23efc62 Mon Sep 17 00:00:00 2001 From: "cyril.tsui" Date: Tue, 24 Oct 2023 16:32:07 +0800 Subject: [PATCH] fix br effective date can be earlier than the apply date of application (prepress doc p.11-12) --- src/pages/authentication/auth-forms/BusCustomFormWizard.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pages/authentication/auth-forms/BusCustomFormWizard.js b/src/pages/authentication/auth-forms/BusCustomFormWizard.js index 6687149..6eddf8a 100644 --- a/src/pages/authentication/auth-forms/BusCustomFormWizard.js +++ b/src/pages/authentication/auth-forms/BusCustomFormWizard.js @@ -447,7 +447,7 @@ const BusCustomFormWizard = (props) => { faxCountryCode: yup.string().min(2,'請輸入最少2位數字'), phone: yup.string().min(8,'請輸入最少8位數字').required('請輸入聯絡電話'), fax: yup.string().min(8,'請輸入最少8位數字'), - brExpiryDate: yup.string().min(8).required('請輸入商業登記證有效日期'), + brExpiryDate: yup.date().min(new Date().toISOString().split("T")[0], '請輸入商業登記證有效日期').max("2099-12-31", '請輸入商業登記證有效日期').required('請輸入商業登記證有效日期'), brNo: yup.string().min(8,'請輸入商業登記證號碼').required('請輸入商業登記證號碼'), captchaField: yup.string().required('請輸入驗證').oneOf([captcha], '請輸入有效驗證'), }) @@ -754,8 +754,10 @@ const BusCustomFormWizard = (props) => { value={formik.values.brExpiryDate} name="brExpiryDate" onChange={formik.handleChange} + onBlur={formik.handleBlur} placeholder="與商業登記證相同" inputProps={{ + max: "2099-12-31", min: new Date().toISOString().split("T")[0], onKeyDown: (e) => { if (e.key === 'Enter') {