Skip to content

Commit

Permalink
Trim SceneForm date and duration (#421)
Browse files Browse the repository at this point in the history
  • Loading branch information
peolic authored Jun 6, 2022
1 parent 6be7f2d commit e7081f1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions frontend/src/pages/scenes/sceneForm/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export const SceneSchema = yup.object({
details: yup.string().trim(),
date: yup
.string()
.trim()
.defined()
.transform(nullCheck)
.matches(/^\d{4}$|^\d{4}-\d{2}$|^\d{4}-\d{2}-\d{2}$/, {
Expand All @@ -21,6 +22,7 @@ export const SceneSchema = yup.object({
.required("Release date is required"),
duration: yup
.string()
.trim()
.matches(/^((\d+:)?([0-5]?\d):)?([0-5]?\d)$/, {
excludeEmptyString: true,
message: "Invalid duration, format should be HH:MM:SS",
Expand Down

0 comments on commit e7081f1

Please sign in to comment.