+2
-1
@@ -99,4 +99,5 @@ var exports, | ||
| var date = this.realDate ? this.source : moment(); | ||
| // Set the timezone if given (http://momentjs.com/timezone/docs/#/using-timezones/parsing-in-zone/) | ||
| if (this.zone) | ||
| date = date.utcOffset(this.zone); | ||
| date = date.tz(this.zone); | ||
@@ -103,0 +104,0 @@ if (this.realDate) |
+1
-1
| { | ||
| "name": "cron", | ||
| "description": "Cron jobs for your node", | ||
| "version": "1.0.8", | ||
| "version": "1.0.9", | ||
| "author": "Nick Campbell <nicholas.j.campbell@gmail.com> (http://github.com/ncb000gt)", | ||
@@ -6,0 +6,0 @@ "bugs" : { |
+38
-0
@@ -239,2 +239,40 @@ var testCase = require('nodeunit').testCase, | ||
| }, | ||
| 'test a job with a string and a given time zone': function (assert) { | ||
| var clock = sinon.useFakeTimers(); | ||
| assert.expect(2); | ||
| var moment = require("moment-timezone"); | ||
| var zone = "America/Chicago"; | ||
| // New Orleans time | ||
| var t = moment(); | ||
| t.tz(zone); | ||
| // Current time | ||
| d = moment(); | ||
| // If current time is New Orleans time, switch to Los Angeles.. | ||
| if (t.hours() === d.hours()) { | ||
| zone = "America/Los_Angeles"; | ||
| t.tz(zone); | ||
| } | ||
| assert.notEqual(d.hours(), t.hours()); | ||
| // If t = 59s12m then t.setSeconds(60) | ||
| // becones 00s13m so we're fine just doing | ||
| // this and no testRun callback. | ||
| t.add(1, 's'); | ||
| // Run a job designed to be executed at a given | ||
| // time in `zone`, making sure that it is a different | ||
| // hour than local time. | ||
| var job = new cron.CronJob(t.seconds() + ' ' + t.minutes() + ' ' + t.hours() + ' * * *', function(){ | ||
| assert.ok(true); | ||
| }, null, true, zone); | ||
| clock.tick(1000); | ||
| clock.restore(); | ||
| job.stop(); | ||
| assert.done(); | ||
| }, | ||
| 'test a job with a date and a given time zone': function (assert) { | ||
@@ -241,0 +279,0 @@ assert.expect(2); |
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
38282
2.91%1029
3.21%