Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not handle weird Google calendar timestamp + TZ combos #50

Open
jayjanssen opened this issue Feb 19, 2015 · 3 comments · May be fixed by #114
Open

Does not handle weird Google calendar timestamp + TZ combos #50

jayjanssen opened this issue Feb 19, 2015 · 3 comments · May be fixed by #114

Comments

@jayjanssen
Copy link

I found that this module will not parse events that contain DTSTART or DTEND values that look like this:

DTSTART;TZID=America/Los_Angeles:20140505T183000

The events simply don't show up in the output.

@jonmaim
Copy link

jonmaim commented Mar 3, 2015

@jayjanssen got a similar issue but then realized there are different kinds of events like VEVENT and VTIMEZONE that are returned by the lib. In my case, skipping VTIMEZONE events made the trick.

@jessefulton
Copy link

+1

@ghost
Copy link

ghost commented Feb 2, 2018

In case anyone is wondering, this fixes it, tidies things up, as well as stopping jsonhint complaining about the example code

'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')}`);

			}
		}
	}
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants