Skip to content

Commit

Permalink
Exception check at the 'seconds' level.
Browse files Browse the repository at this point in the history
Signed-off-by: Nick Campbell <nicholas.j.campbell@gmail.com>
  • Loading branch information
ncb000gt committed Dec 17, 2018
1 parent 41060fd commit aaf8d42
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/cron.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@
}

if (this.realDate) {
const diff = moment().diff(date);
const diff = moment().diff(date, 's');
if (diff > 0) {
throw new Error('WARNING: Date in past. Will never be fired.');
}
Expand Down
2 changes: 1 addition & 1 deletion tests/test-crontime.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ describe('crontime', function() {
});

it('should test next real date', function() {
var initialDate = new Date()
var initialDate = new Date();
var ct = new cron.CronTime(initialDate);

var nextDate = new Date();
Expand Down

0 comments on commit aaf8d42

Please sign in to comment.