mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-27 03:39:55 +00:00
parent
864106d336
commit
a4d5b74b57
@ -70,7 +70,7 @@ var CalendarFetcher = function(url, reloadInterval, maximumEntries, maximumNumbe
|
||||
for (var d in dates) {
|
||||
startDate = moment(new Date(dates[d]));
|
||||
newEvents.push({
|
||||
title: event.summary,
|
||||
title: (typeof event.summary.val !== 'undefined') ? event.summary.val : event.summary,
|
||||
startDate: startDate.format('x')
|
||||
});
|
||||
}
|
||||
@ -80,7 +80,7 @@ var CalendarFetcher = function(url, reloadInterval, maximumEntries, maximumNumbe
|
||||
|
||||
if (startDate > today && startDate <= today.add(maximumNumberOfDays, 'days')) {
|
||||
newEvents.push({
|
||||
title: event.summary,
|
||||
title: (typeof event.summary.val !== 'undefined') ? event.summary.val : event.summary,
|
||||
startDate: startDate.format('x')
|
||||
});
|
||||
}
|
||||
|
@ -7,6 +7,7 @@
|
||||
|
||||
var FeedMe = require('feedme');
|
||||
var request = require('request');
|
||||
var iconv = require('iconv-lite');
|
||||
|
||||
var NewsFetcher = function() {
|
||||
var self = this;
|
||||
@ -19,7 +20,6 @@ var NewsFetcher = function() {
|
||||
var parser = new FeedMe();
|
||||
|
||||
parser.on('item', function(item) {
|
||||
//console.log(item);
|
||||
self.items.push({
|
||||
title: item.title,
|
||||
pubdate: item.pubdate,
|
||||
@ -46,7 +46,7 @@ var NewsFetcher = function() {
|
||||
self.fetchNews = function(url, success, error) {
|
||||
self.successCallback = success;
|
||||
self.errorCallback = error;
|
||||
request(url).pipe(parser);
|
||||
request({uri:url, encoding:null}).pipe(iconv.decodeStream('ISO-8859-1')).pipe(parser);
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -34,6 +34,7 @@
|
||||
"feedme": "latest",
|
||||
"valid-url": "latest",
|
||||
"ical": "latest",
|
||||
"moment": "latest"
|
||||
"moment": "latest",
|
||||
"iconv-lite": "latest"
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user