Skip to content

Commit

Permalink
#build-patch: update range validation for minutes and seconds to incl…
Browse files Browse the repository at this point in the history
…ude 60
  • Loading branch information
reskume committed Dec 5, 2024
1 parent e7467ce commit 57b293a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/formats/base-format.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ export class BaseFormat implements IFormatParser {
throw new Error('minutes must be numeric');
}
const min = Number.parseFloat((minutes as any).toString());
if (min < 0 || min >= 60) {
throw new Error('minutes must be within the range of 0 to 59');
if (min < 0 || min > 60) {
throw new Error('minutes must be within the range of 0 to 60');
}
}

Expand All @@ -101,8 +101,8 @@ export class BaseFormat implements IFormatParser {
throw new Error('seconds must be numeric');
}
const sec = Number.parseFloat(seconds.toString());
if (sec < 0 || sec >= 60) {
throw new Error('seconds must be within the range of 0 to 59');
if (sec < 0 || sec > 60) {
throw new Error('seconds must be within the range of 0 to 60');
}
}

Expand Down

0 comments on commit 57b293a

Please sign in to comment.