diff --git a/lib/time.js b/lib/time.js index c2830b98..a753da63 100644 --- a/lib/time.js +++ b/lib/time.js @@ -532,10 +532,10 @@ function CronTime(luxon) { } else { // non-round or multi-hour jump. (does not exist in the real world at the time of writing) return this._checkTimeInSkippedRangeMultiHour( - startingMinute, - afterJumpingPoint.minute, startingHour, - afterJumpingPoint.hour + startingMinute, + afterJumpingPoint.hour, + afterJumpingPoint.minute ); } }, @@ -571,12 +571,17 @@ function CronTime(luxon) { * * If any hour x minute combination is a valid time, true is returned. * The endMinute x endHour combination is only checked with the 0th second, since the rest would be out of the range. + * + * @param startHour {number} + * @param startMinute {number} + * @param endHour {number} + * @param endMinute {number} */ _checkTimeInSkippedRangeMultiHour: function ( - startMinute, - endMinute, startHour, - endHour + startMinute, + endHour, + endMinute ) { if (startHour >= endHour) { throw new Error( diff --git a/tests/crontime.test.js b/tests/crontime.test.js index 559a0bf1..01207143 100644 --- a/tests/crontime.test.js +++ b/tests/crontime.test.js @@ -514,7 +514,7 @@ describe('crontime', () => { it('Enforces the hour difference assumption for handling multi-hour DST jumps', () => { const cronTime = new cron.CronTime('30 16 * * *'); expect(() => { - cronTime._checkTimeInSkippedRangeMultiHour(0, 30, 15, 15); + cronTime._checkTimeInSkippedRangeMultiHour(15, 0, 15, 30); }).toThrow(); }); it('should generate the right N next days for * * * * *', () => {