mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-27 11:50:00 +00:00
17 lines
522 B
JavaScript
17 lines
522 B
JavaScript
'use strict';
|
|
|
|
const ical = require('ical');
|
|
const months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
|
|
|
ical.fromURL('http://lanyrd.com/topics/nodejs/nodejs.ics', {}, function (err, data) {
|
|
for (let k in data) {
|
|
if (data.hasOwnProperty(k)) {
|
|
var ev = data[k];
|
|
if (data[k].type == 'VEVENT') {
|
|
console.log(`${ev.summary} is in ${ev.location} on the ${ev.start.getDate()} of ${months[ev.start.getMonth()]} at ${ev.start.toLocaleTimeString('en-GB')}`);
|
|
|
|
}
|
|
}
|
|
}
|
|
});
|