node-schedule
Advanced tools
Comparing version 1.3.0 to 1.3.1
@@ -191,6 +191,10 @@ | ||
// save passed-in value before 'spec' is replaced | ||
if (typeof spec === 'object' && 'tz' in spec) { | ||
tz = spec.tz; | ||
} | ||
if (typeof spec === 'object' && spec.rule) { | ||
start = spec.start || undefined; | ||
end = spec.end || undefined; | ||
tz = spec.tz; | ||
spec = spec.rule; | ||
@@ -402,2 +406,7 @@ | ||
RecurrenceRule.prototype.nextInvocationDate = function(base) { | ||
var next = this._nextInvocationDate(base); | ||
return next ? next.toDate() : null; | ||
}; | ||
RecurrenceRule.prototype._nextInvocationDate = function(base) { | ||
base = ((base instanceof CronDate) || (base instanceof Date)) ? base : (new Date()); | ||
@@ -469,3 +478,3 @@ if (!this.recurs) { | ||
return next ? next.toDate() : null; | ||
return next; | ||
}; | ||
@@ -499,3 +508,3 @@ | ||
var then = date.getTime(); | ||
return lt.setTimeout(function() { | ||
@@ -581,3 +590,3 @@ if (then > Date.now()) | ||
var date = (rule instanceof RecurrenceRule) ? rule.nextInvocationDate(prevDate) : rule.next(); | ||
var date = (rule instanceof RecurrenceRule) ? rule._nextInvocationDate(prevDate) : rule.next(); | ||
if (date === null) { | ||
@@ -584,0 +593,0 @@ return null; |
{ | ||
"name": "node-schedule", | ||
"version": "1.3.0", | ||
"version": "1.3.1", | ||
"description": "A cron-like and not-cron-like job scheduler for Node.", | ||
@@ -27,3 +27,3 @@ "keywords": [ | ||
"dependencies": { | ||
"cron-parser": "^2.4.0", | ||
"cron-parser": "^2.7.3", | ||
"long-timeout": "0.1.1", | ||
@@ -30,0 +30,0 @@ "sorted-array-functions": "^1.0.0" |
@@ -168,9 +168,9 @@ # Node Schedule | ||
- `second` | ||
- `minute` | ||
- `hour` | ||
- `date` | ||
- `month` | ||
- `second (0-59)` | ||
- `minute (0-59)` | ||
- `hour (0-23)` | ||
- `date (1-31)` | ||
- `month (0-11)` | ||
- `year` | ||
- `dayOfWeek` | ||
- `dayOfWeek (0-6) Starting with Sunday` | ||
@@ -208,7 +208,7 @@ > **Note**: It's worth noting that the default value of a component of a recurrence rule is | ||
There are some function to get informations for a Job and to handle the Job and | ||
There are some function to get information for a Job and to handle the Job and | ||
Invocations. | ||
#### job.cancel(reshedule) | ||
#### job.cancel(reschedule) | ||
You can invalidate any job with the `cancel()` method: | ||
@@ -222,3 +222,3 @@ | ||
#### job.cancelNext(reshedule) | ||
#### job.cancelNext(reschedule) | ||
This method invalidates the next planned invocation or the job. | ||
@@ -225,0 +225,0 @@ When you set the parameter ***reschedule*** to true then the Job is newly scheduled |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
82536
2333
1
+ Addedgopd@1.1.0(transitive)
- Removedgopd@1.0.1(transitive)
Updatedcron-parser@^2.7.3