Skip to content

Commit

Permalink
fix(protocol-designer): allow minutesSeconds timer fields to add more… (
Browse files Browse the repository at this point in the history
#17185)

… than 99 minutes

closes RQA-3817
  • Loading branch information
jerader authored Jan 6, 2025
1 parent ebdfc84 commit 20e1dd3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions protocol-designer/src/steplist/fieldLevel/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ export type ErrorChecker = (value: unknown) => string | null
export const requiredField: ErrorChecker = (value: unknown) =>
!value ? FIELD_ERRORS.REQUIRED : null
export const isTimeFormat: ErrorChecker = (value: unknown): string | null => {
const timeRegex = new RegExp(/^\d{1,2}:\d{1,2}:\d{1,2}$/g)
const timeRegex = new RegExp(/^\d{1,2}:(?:[0-5]?\d):(?:[0-5]?\d)$/g)
return (typeof value === 'string' && timeRegex.test(value)) || !value
? null
: FIELD_ERRORS.BAD_TIME_HMS
}
export const isTimeFormatMinutesSeconds: ErrorChecker = (
value: unknown
): string | null => {
const timeRegex = new RegExp(/^\d{1,2}:\d{1,2}$/g)
const timeRegex = new RegExp(/^\d+:[0-5]?\d$/g)
return (typeof value === 'string' && timeRegex.test(value)) || !value
? null
: FIELD_ERRORS.BAD_TIME_MS
Expand Down

0 comments on commit 20e1dd3

Please sign in to comment.