diff --git a/controllers/functions/gzip.php b/controllers/functions/gzip.php index 77d0d39d..ee7b4518 100644 --- a/controllers/functions/gzip.php +++ b/controllers/functions/gzip.php @@ -30,7 +30,7 @@ * @note If http response header mentions that content is gzipped, then uncompress it. */ foreach($http_response_header as $c => $h) { - if(stristr($h, "content-encoding") and stristr($h, "gzip") { + if(stristr($h, "content-encoding") and stristr($h, "gzip")) { /* * @note Now, let's begin the actual purpose of this function: */ diff --git a/js/calendar/calendar.js b/js/calendar/calendar.js index 546a8d25..9bd400f2 100644 --- a/js/calendar/calendar.js +++ b/js/calendar/calendar.js @@ -63,15 +63,17 @@ calendar.updateData = function (callback) { } e.seconds = seconds; } - + // Special handling for rrule events if (e.RRULE) { var options = new RRule.parseString(e.RRULE); options.dtstart = e.startDate; var rule = new RRule(options); - - // TODO: don't use fixed end date here, use something like now() + 1 year - var dates = rule.between(new Date(), new Date(2016,11,31), true, function (date, i){return i < 10}); + + var oneYear = new Date(); + oneYear.setFullYear(oneYear.getFullYear() + 1); + + var dates = rule.between(new Date(), oneYear, true, function (date, i){return i < 10}); for (date in dates) { var dt = new Date(dates[date]); var days = moment(dt).diff(moment(), 'days'); @@ -84,7 +86,7 @@ calendar.updateData = function (callback) { var time_string = moment(dt).calendar() } this.eventList.push({'description':e.SUMMARY,'seconds':seconds,'days':time_string}); - } + } } } };