Skip to content

Commit

Permalink
add validation for admission_date in consultation form (#6746)
Browse files Browse the repository at this point in the history
  • Loading branch information
sriharsh05 authored Nov 29, 2023
1 parent 4da37ba commit 8d9479b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Components/Facility/ConsultationForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,10 @@ export const ConsultationForm = (props: any) => {
errors[field] = "Field is required";
invalidForm = true;
}
if (dayjs(state.form.admission_date).isBefore(dayjs("2000-01-01"))) {
errors[field] = "Admission date cannot be before 01/01/2000";
invalidForm = true;
}
return;
case "cause_of_death":
if (state.form.suggestion === "DD" && !state.form[field]) {
Expand Down

0 comments on commit 8d9479b

Please sign in to comment.