I am planning on using node-schedule to set up push notifications for appointment reminders as follows:
var schedule = require(\'node-schedule\');
var date =
In order to retrieve a specific job, you could create it with a unique name and you can retrieve it later via that unique name:
var j = schedule.scheduleJob(unique_name, date, function() {
});
// later on
var my_job = schedule.scheduledJobs[unique_name];
my_job.cancel();
var randf = require('randomstring');
var jobId = randf.generate(10); //randomsrting
var at = new Date();
var time = at.setSeconds(at.getSeconds() + Number(5)) //after 5 second
schedule.scheduleJob(jobId, new Date(time),function(){
schedule.cancelJob(jobId);
console.log('hi--viral');
});