cron
Advanced tools
Comparing version 1.5.0 to 1.5.1
@@ -35,3 +35,3 @@ (function(root, factory) { | ||
if (utcOffset) this.utcOffset = utcOffset; | ||
if (typeof utcOffset !== 'undefined') this.utcOffset = utcOffset; | ||
@@ -142,3 +142,3 @@ var that = this; | ||
if (this.utcOffset) { | ||
if (typeof this.utcOffset !== 'undefined') { | ||
date = date.utcOffset(this.utcOffset); | ||
@@ -145,0 +145,0 @@ } |
{ | ||
"name": "cron", | ||
"description": "Cron jobs for your node", | ||
"version": "1.5.0", | ||
"version": "1.5.1", | ||
"author": "Nick Campbell <nicholas.j.campbell@gmail.com> (http://github.com/ncb000gt)", | ||
@@ -6,0 +6,0 @@ "bugs": { |
@@ -5,2 +5,3 @@ var chai = require('chai'); | ||
var moment = require('moment-timezone'); | ||
var sinon = require('sinon'); | ||
@@ -301,2 +302,26 @@ // most eslint errors here are due to side effects. i don't care much about them right now | ||
}); | ||
it('should accept 0 as a valid UTC offset', function() { | ||
var clock = sinon.useFakeTimers(); | ||
var cronTime = new cron.CronTime('0 11 * * *', null, 0); | ||
var expected = moment().add(11, 'hours').unix(); | ||
var actual = cronTime.sendAt().unix(); | ||
expect(actual).to.equal(expected); | ||
clock.restore(); | ||
}); | ||
it('should accept -120 as a valid UTC offset', function() { | ||
var clock = sinon.useFakeTimers(); | ||
var cronTime = new cron.CronTime('0 11 * * *', null, -120); | ||
var expected = moment().add(13, 'hours').unix(); | ||
var actual = cronTime.sendAt().unix(); | ||
expect(actual).to.equal(expected); | ||
clock.restore(); | ||
}); | ||
}); |
61652
25
1896