Skip to content

Commit

Permalink
make time field mandatory
Browse files Browse the repository at this point in the history
  • Loading branch information
rithviknishad committed Jul 26, 2023
1 parent 68c6d9d commit c6d19c5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ export default function InvestigationBuilder(
</div>
) : (
<div className="w-full">
<div className="mb-1">Time</div>
Time<span className="text-danger-500">{" *"}</span>
<input
type="datetime-local"
className="block w-[calc(100%-5px)] rounded border border-gray-400 bg-gray-100 px-4 py-2 text-sm hover:bg-gray-200 focus:border-primary-500 focus:bg-white focus:outline-none focus:ring-primary-500"
Expand Down
7 changes: 6 additions & 1 deletion src/Components/Facility/ConsultationForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,12 @@ export const ConsultationForm = (props: any) => {
break;
}
if (i.repetitive && !i.frequency?.replace(/\s/g, "").length) {
errors[field] = "Frequency field can not be empty";
errors[field] = "Frequency field cannot be empty";
invalidForm = true;
break;
}
if (!i.repetitive && !i.time?.replace(/\s/g, "").length) {
errors[field] = "Time field cannot be empty";
invalidForm = true;
break;
}
Expand Down

0 comments on commit c6d19c5

Please sign in to comment.