cron-parser
Advanced tools
Comparing version 4.3.0 to 4.4.0
@@ -575,3 +575,3 @@ 'use strict'; | ||
// Add or subtract day if select day not match with month (according to calendar) | ||
if (!dayOfMonthMatch && !dayOfWeekMatch) { | ||
if (!dayOfMonthMatch && (!dayOfWeekMatch || isDayOfWeekWildcardMatch)) { | ||
this._applyTimezoneShift(currentDate, dateMathVerb, 'Day'); | ||
@@ -578,0 +578,0 @@ continue; |
{ | ||
"name": "cron-parser", | ||
"version": "4.3.0", | ||
"version": "4.4.0", | ||
"description": "Node.js library for parsing crontab instructions", | ||
@@ -5,0 +5,0 @@ "main": "lib/parser.js", |
@@ -922,2 +922,48 @@ var test = require('tap').test; | ||
test('day of month contains multiple ranges and day of week is wildcard', function(t) { | ||
try { | ||
var options = { | ||
currentDate: new CronDate('Sat, 1 Dec 2012 14:38:53') | ||
}; | ||
var interval = CronExpression.parse('0 0 0 2-4,7-31 * *', options); | ||
t.ok(interval, 'Interval parsed'); | ||
var next = interval.next(); | ||
t.ok(next, 'Found next scheduled interval'); | ||
t.ok(next.getDate() === 2, 'Day of month matches'); | ||
t.equal(next.getMonth(), 11, 'Month matches'); | ||
next = interval.next(); | ||
t.ok(next, 'Found next scheduled interval'); | ||
t.ok(next.getDate() === 3, 'Day of month matches'); | ||
t.equal(next.getMonth(), 11, 'Month matches'); | ||
next = interval.next(); | ||
t.ok(next, 'Found next scheduled interval'); | ||
t.ok(next.getDate() === 4, 'Day of month matches'); | ||
t.equal(next.getMonth(), 11, 'Month matches'); | ||
next = interval.next(); | ||
t.ok(next, 'Found next scheduled interval'); | ||
t.ok(next.getDate() === 7, 'Day of month matches'); | ||
t.equal(next.getMonth(), 11, 'Month matches'); | ||
next = interval.next(); | ||
t.ok(next, 'Found next scheduled interval'); | ||
t.ok(next.getDate() === 8, 'Day of month matches'); | ||
t.equal(next.getMonth(), 11, 'Month matches'); | ||
next = interval.next(); | ||
} catch (err) { | ||
t.error(err, 'Interval parse error'); | ||
} | ||
t.end(); | ||
}); | ||
test('day of month and week are both set and dow is 6,0', function(t) { | ||
@@ -962,3 +1008,3 @@ try { | ||
test('day of month and week are both set and dow is 6-7', function(t) { | ||
test('day of month and week are both set and dow is a range with value 6-7', function(t) { | ||
try { | ||
@@ -965,0 +1011,0 @@ var options = { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
147061
4185