Skip to content

Commit

Permalink
Add validation for negative durations
Browse files Browse the repository at this point in the history
  • Loading branch information
smartspot2 committed Feb 29, 2024
1 parent ce2a6c7 commit 0e907a8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions csm_web/frontend/src/components/course/CreateSectionModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ export const CreateSectionModal = ({ courseId, closeModal, reloadSections }: Cre
} else if (spacetime.startTime === "") {
setValidationText("All section occurrences must have a specified start time");
return false;
} else if (isNaN(spacetime.duration) || spacetime.duration === 0) {
setValidationText("All section occurrences must have nonzero duration");
} else if (isNaN(spacetime.duration) || spacetime.duration <= 0) {
setValidationText("All section occurrences must have duration greater than 0");
return false;
}
}
Expand Down

0 comments on commit 0e907a8

Please sign in to comment.