17 lines
522 B
JavaScript
Raw Normal View History

2019-06-13 09:36:31 -05:00
'use strict';
2016-04-20 11:32:48 +02:00
2019-06-13 09:36:31 -05:00
const ical = require('ical');
const months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
2016-04-20 11:32:48 +02:00
2019-06-13 09:36:31 -05:00
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')}`);
2016-04-20 11:32:48 +02:00
2019-06-13 09:36:31 -05:00
}
}
}
});