Comparing version 0.4.2 to 0.4.3
0.4.3 / 2013-12-13 | ||
================== | ||
* fix job.schedule's taking Date object as 'when' argument [@bars3s] | ||
0.4.2 / 2013-12-11 | ||
@@ -3,0 +8,0 @@ ================== |
@@ -68,3 +68,3 @@ var humanInterval = require('human-interval'), | ||
Job.prototype.schedule = function(time) { | ||
this.attrs.nextRunAt = date(time); | ||
this.attrs.nextRunAt = (time instanceof Date) ? time : date(time); | ||
return this; | ||
@@ -71,0 +71,0 @@ }; |
{ | ||
"name": "agenda", | ||
"version": "0.4.2", | ||
"version": "0.4.3", | ||
"description": "Light weight job scheduler for Node.js", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -213,3 +213,3 @@ # Agenda | ||
`data` is an optional argument that will be passed to the processing function | ||
under `job.data`. | ||
under `job.attrs.data`. | ||
@@ -216,0 +216,0 @@ Returns the `job`. |
@@ -173,2 +173,3 @@ var expect = require('expect.js'), | ||
describe('schedule', function() { | ||
var job; | ||
beforeEach(function() { | ||
@@ -181,2 +182,8 @@ job = new Job(); | ||
}); | ||
it('sets the next run time Date object', function() { | ||
var when = new Date(Date.now() + 1000*60*3); | ||
job.schedule(when); | ||
expect(job.attrs.nextRunAt).to.be.a(Date); | ||
expect(job.attrs.nextRunAt.getTime()).to.eql(when.getTime()); | ||
}); | ||
it('returns the job', function() { | ||
@@ -183,0 +190,0 @@ expect(job.schedule('tomorrow at noon')).to.be(job); |
Sorry, the diff of this file is not supported yet
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
34217
657