Skip to content

Instantly share code, notes, and snippets.

@jasonVeld
Created August 28, 2014 05:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jasonVeld/7877ff4c5171234257cb to your computer and use it in GitHub Desktop.
Save jasonVeld/7877ff4c5171234257cb to your computer and use it in GitHub Desktop.
node-schedule erroneously schedules immediately rather than on specified date
var http = require('http'),
path = require('path'),
os = require('os'),
fs = require('fs');
var deferred = require('deferred');
var schedule = require('node-schedule');
var handler_1 = function() {
console.log("Handler 1 running");
};
var handler_2 = function(param) {
return function() {
console.log("Handler 2 running");
}
};
var start_date = new Date(1411999200000);
var h = handler_2('test');
console.log("handler type: " + typeof(h));
console.log("scheduling job... ");
schedule.scheduleJob(new Date('15 October 2014'), h );
OUTPUT:
==========================
handler type: function
scheduling job...
Handler 2 running
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment