Skip to content

Commit

Permalink
fix: only validate past application dates if non-empty
Browse files Browse the repository at this point in the history
  • Loading branch information
kriscooke committed Nov 30, 2020
1 parent 97c06b1 commit 2c52762
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions app/containers/Admin/ReportingYear/reportingYearValidation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,11 @@ function validateApplicationDates(
errors.addError(`${ERRORS.PAST_DATE} Application open time`);
}

const closeDateIsPast =
validateFutureApplicationClose && isPastDate(closeDate);
if (
Boolean(closeDate) &&
!uiSchema.applicationCloseTime['ui:disabled'] &&
closeDateIsPast
validateFutureApplicationClose &&
isPastDate(closeDate)
) {
errors.addError(`${ERRORS.PAST_DATE} Application close time`);
}
Expand Down

0 comments on commit 2c52762

Please sign in to comment.