From 4141bdb8eaa28ffb01b63ea3a5b97f67ed9b2684 Mon Sep 17 00:00:00 2001 From: Tim Schumacher Date: Sun, 11 Aug 2013 18:14:53 +0200 Subject: [PATCH] Seperated date and time for the start- and enddates. Also added the some variables for current dates. --- event.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/event.js b/event.js index 7f3b599..d291f4d 100644 --- a/event.js +++ b/event.js @@ -48,13 +48,19 @@ EventTool.prototype.events = []; EventTool.prototype.processEventData = function() { var self = this; var view = { - events: [] + events: [], + day: strftime('%d',new Date()), + month: strftime('%m',new Date()), + year: strftime('%Y',new Date()), + week: strftime('%U',new Date()) }; // prepare the data self.events.forEach(function(el) { var item = {}; - item['startdate'] = strftime('%Y-%m-%d %H:%M',el.startdate); + item['startdate'] = strftime('%Y-%m-%d',el.startdate); + item['starttime'] = strftime('%H:%M',el.startdate); item['enddate'] = strftime('%Y-%m-%d %H:%M',el.enddate); + item['endtime'] = strftime('%H:%M',el.enddate); item['heading'] = el.heading; item['text'] = el.text; view.events.push(item);