Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Fixed loss of timeZone when the parameters are passed as an object. #37

Merged
merged 1 commit into from

3 participants

@baryshev

No description provided.

@travisbot

This pull request passes (merged 912fb5e into bec0721).

@ncb000gt
Owner

I'm not sure I follow. You've moved one line after the other. How was the timezone lost when passed as an object?

@baryshev

Object passed to function in the cronTime variable. In the previous version cronTime variable extracts from object (cronTime) before timeZone variable and redefine it. In next line cronTime.timeZone always undefined because cronTime already string, not object with parameters.

@ncb000gt ncb000gt merged commit b74a8c0 into ncb000gt:master
@ncb000gt
Owner

You should have heard me when I went back to look at the code...I think I sounded like a wounded walrus...or at least what I'd imagine a wounded walrus to sound like.

That was a stupid mistake. Thanks for catching this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  lib/cron.js
View
2  lib/cron.js
@@ -233,8 +233,8 @@ function CronJob(cronTime, onTick, onComplete, start, timeZone) {
onTick = cronTime.onTick;
onComplete = cronTime.onComplete;
start = cronTime.start;
- cronTime = cronTime.cronTime;
timeZone = cronTime.timeZone;
+ cronTime = cronTime.cronTime;
}
if (timeZone && !(CronDate.prototype.setTimezone)) console.log('You specified a Timezone but have not included the `time` module. Timezone functionality is disabled. Please install the `time` module to use Timezones in your application.');
Something went wrong with that request. Please try again.