From b297c99cbdaa80fb8601a60125758782cc8425d1 Mon Sep 17 00:00:00 2001 From: Michael Teeuw Date: Fri, 28 Feb 2014 11:13:15 +0100 Subject: [PATCH] Calendar date fix --- js/main.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/js/main.js b/js/main.js index d0e0c847..0a2d483f 100644 --- a/js/main.js +++ b/js/main.js @@ -121,7 +121,10 @@ jQuery(document).ready(function($) { } } - var days = moment(e.startDate).diff(moment(new Date()), 'days'); + + var now = new Date(); + var today = new Date(now.getFullYear(), now.getMonth(), now.getDate()); + var days = moment(e.startDate).diff(moment(today), 'days'); eventList.push({'description':e.SUMMARY,'days':days}); }; @@ -160,7 +163,7 @@ jQuery(document).ready(function($) { setTimeout(function() { updateCalendar(); - }, 5000); + }, 1000); })(); (function updateCompliment()