thybag / JavaScript-Ical-Parser

Proof of concept Javascript ical (.ics) parser
39 stars 19 forks source link

Variables not set #2

Open mody7860 opened 11 years ago

mody7860 commented 11 years ago

Hi, Great job on the parser algorithm. There is a small issue in the code with regards to setting dates for DTSTART and DTEND objects. The logic is doing a comparison to the string but the string does not return a match because DTSTART & DTEND are present as a substring with other characters. It could very well be that the ics file i am using is slightly off the standard format. By using indexof instead of a perfect match comparison (==) the code worked like a charm.

OLD - if(type == 'DTEND')

NEW - if(type.indexOf('DTEND') != -1 ){

Thanks