From e90cf673e328bd00aa5e1663226ea2c28773f1fd Mon Sep 17 00:00:00 2001 From: Bryan Ashby Date: Tue, 13 Sep 2016 21:44:35 -0600 Subject: [PATCH] Updates to event scheduler --- core/bbs.js | 2 ++ core/event_scheduler.js | 2 ++ 2 files changed, 4 insertions(+) diff --git a/core/bbs.js b/core/bbs.js index a0bf2ac5..816dfee6 100644 --- a/core/bbs.js +++ b/core/bbs.js @@ -141,6 +141,8 @@ function initialize(cb) { '**** ENiGMA½ Bulletin Board System Starting Up! ****'); process.on('SIGINT', shutdownSystem); + + require('later').date.localTime(); // use local times for later.js/scheduling return callback(null); }, diff --git a/core/event_scheduler.js b/core/event_scheduler.js index e6f94bd1..a1c2f6ef 100644 --- a/core/event_scheduler.js +++ b/core/event_scheduler.js @@ -11,6 +11,7 @@ const later = require('later'); const path = require('path'); const pty = require('ptyw.js'); const gaze = require('gaze'); +const moment = require('moment'); exports.getModule = EventSchedulerModule; exports.EventSchedulerModule = EventSchedulerModule; // allow for loadAndStart @@ -214,6 +215,7 @@ EventSchedulerModule.prototype.startup = function(cb) { eventName : schedEvent.name, schedule : this.moduleConfig.events[schedEvent.name].schedule, action : schedEvent.action, + next : moment(later.schedule(schedEvent.schedule.sched).next(1)).format('ddd, MMM Do, YYYY @ h:m:ss a') }, 'Scheduled event loaded' );