Skip to content

Dates with TZID incorrectly parsed with locale #6

@RideLikeTheWind

Description

@RideLikeTheWind

I have been reading an ICS file from a system we use and some dates that come in are pre-set in current (locale) time. They have the TZID param. In the code, index.js line 63ish you check the parameter:

if(params["TZID"] !== undefined) { ...

Which is ok, but the time returns incorrectly. I had to add this:

if(params["TZID"].search(/\//) != -1){
params["TZID"] = params["TZID"].slice(1);
}
events[event_count][k].value.toLocaleString(undefined, {timeZone: params["TZID"]});

which reduces the time by the timezone appropriately.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions