mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-08-23 05:20:03 +00:00
Merge remote-tracking branch 'MichMich/master'
This commit is contained in:
@@ -30,7 +30,7 @@
|
|||||||
* @note If http response header mentions that content is gzipped, then uncompress it.
|
* @note If http response header mentions that content is gzipped, then uncompress it.
|
||||||
*/
|
*/
|
||||||
foreach($http_response_header as $c => $h) {
|
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:
|
* @note Now, let's begin the actual purpose of this function:
|
||||||
*/
|
*/
|
||||||
|
@@ -63,15 +63,17 @@ calendar.updateData = function (callback) {
|
|||||||
}
|
}
|
||||||
e.seconds = seconds;
|
e.seconds = seconds;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Special handling for rrule events
|
// Special handling for rrule events
|
||||||
if (e.RRULE) {
|
if (e.RRULE) {
|
||||||
var options = new RRule.parseString(e.RRULE);
|
var options = new RRule.parseString(e.RRULE);
|
||||||
options.dtstart = e.startDate;
|
options.dtstart = e.startDate;
|
||||||
var rule = new RRule(options);
|
var rule = new RRule(options);
|
||||||
|
|
||||||
// TODO: don't use fixed end date here, use something like now() + 1 year
|
var oneYear = new Date();
|
||||||
var dates = rule.between(new Date(), new Date(2016,11,31), true, function (date, i){return i < 10});
|
oneYear.setFullYear(oneYear.getFullYear() + 1);
|
||||||
|
|
||||||
|
var dates = rule.between(new Date(), oneYear, true, function (date, i){return i < 10});
|
||||||
for (date in dates) {
|
for (date in dates) {
|
||||||
var dt = new Date(dates[date]);
|
var dt = new Date(dates[date]);
|
||||||
var days = moment(dt).diff(moment(), 'days');
|
var days = moment(dt).diff(moment(), 'days');
|
||||||
@@ -84,7 +86,7 @@ calendar.updateData = function (callback) {
|
|||||||
var time_string = moment(dt).calendar()
|
var time_string = moment(dt).calendar()
|
||||||
}
|
}
|
||||||
this.eventList.push({'description':e.SUMMARY,'seconds':seconds,'days':time_string});
|
this.eventList.push({'description':e.SUMMARY,'seconds':seconds,'days':time_string});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user