Skip to content

Commit

Permalink
Update time.js
Browse files Browse the repository at this point in the history
  • Loading branch information
TheKitoInc committed Jul 6, 2024
1 parent 07b049c commit 809b860
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/checks/time.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
const { tryInteger } = require("./types");

module.exports.tryHour = function (value) {
module.exports.tryHour = function (value) {
tryInteger(value);
if (value < 0 || value > 23) {
throw new Error("Hour out of range: " + value);
}
return value;
}
};
module.exports.tryMinute = function (value) {
tryInteger(value);
if (value < 0 || value > 59) {
throw new Error("Minute out of range: " + value);
}
return value;
}
};
module.exports.trySecond = function (value) {
tryInteger(value);
if (value < 0 || value > 59) {
throw new Error("Second out of range: " + value);
}
return value;
}
};

0 comments on commit 809b860

Please sign in to comment.