diff --git a/frontend/benefit/handler/src/components/applicationForm/utils/validation.ts b/frontend/benefit/handler/src/components/applicationForm/utils/validation.ts index 0a27b5261c..361826a28d 100644 --- a/frontend/benefit/handler/src/components/applicationForm/utils/validation.ts +++ b/frontend/benefit/handler/src/components/applicationForm/utils/validation.ts @@ -36,6 +36,7 @@ import { getNumberValueOrNull } from 'shared/utils/string.utils'; import * as Yup from 'yup'; import { getValidationSchema as getDeminimisValidationSchema } from '../formContent/companySection/deMinimisAid/utils/validation'; +import subMonths from 'date-fns/subMonths'; export const getValidationSchema = ( organizationType: string | undefined, @@ -279,9 +280,9 @@ export const getValidationSchema = ( .required(t(VALIDATION_MESSAGE_KEYS.REQUIRED)) .test({ message: t(VALIDATION_MESSAGE_KEYS.DATE_MIN, { - min: convertToUIDateFormat(startOfYear(new Date())), + min: convertToUIDateFormat(subMonths(new Date(), 4)), }), - test: (value = '') => validateDateWithinMonths(value, 6), + test: (value = '') => validateDateWithinMonths(value, 4), }), [APPLICATION_FIELD_KEYS.END_DATE]: Yup.string().required( t(VALIDATION_MESSAGE_KEYS.REQUIRED)