0

I am trying to parse the .ics file in my application. My application has server side java layer and client side javascript part to it. I am using ical4j library to parse it.

Problem is DTSTART of the event is not in UTC format sometimes. And whenever it is not in UTC .ics file has VTIMEZONE component which I am parsing and getting TZID property from it.

Java layer finally send JSON to client. In the above mentioned case DTSTART, DTEND and TZID are being sent in JSON.

Client has to convert DTSTART and DTEND to UTC using TZID. I tried with moment.js since i could not find any other api which can do this.

moment.tz("2014-02-06 05:30", "NorthAmerica/Eastern").format()

With moment.js below is the error I get,

TypeError: Cannot call method 'rule' of undefined

But below code works fine,

moment.tz("2014-02-06 17:30", "America/Toronto").format()

.ics ファイルから TZID をそのまま (つまり、北米/東部) 使用することはできませんか? また、すべてのタイムゾーンでUTCを提供し、遵守も考慮できる他の方法またはJSライブラリはありますか?

4

1 に答える 1