Skip to content

Commit

Permalink
Add trimming to spacetime edit validation
Browse files Browse the repository at this point in the history
  • Loading branch information
smartspot2 committed Feb 29, 2024
1 parent ab82b24 commit fb62911
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const SpaceTimeEditModal = ({
*/
const validateSpacetime = (): boolean => {
// validate spacetime fields
if (location === null || location === undefined || location.length === 0) {
if (location === null || location === undefined || location.trim() === "") {
setValidationText("All section locations must be specified");
return false;
} else if (isPermanent && day <= 0) {
Expand All @@ -60,7 +60,7 @@ const SpaceTimeEditModal = ({
return false;
}

if (!isPermanent && (date === null || date === "")) {
if (!isPermanent && (date === null || date.trim() === "")) {
setValidationText("Section date to override must be specified");
return false;
}
Expand Down

0 comments on commit fb62911

Please sign in to comment.