How do you get a VTimeZone from DtStart in ical4j 4.x? #752
-
We're migrating from 3.x to 4.x, and we used to be able to do:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
To get a VTIMEZONE from a date property with iCal4j 4.x you first need to get the With iCal4j 3.x this lookup was encapsulated in To get the zone id use:TzId tzid = prop.getRequiredParameter("TZID");
ZoneId zoneid = tzid.toZoneId(); // or;
TimeZoneRegistry tzRegistry = TimeZoneRegistryFactory.getInstance().createRegistry(); // use this registry in calendar builder, etc. to register tz definitions from input data
ZoneId zoneid = tzid.toZoneId(tzRegistry); To get the VTIMEZONE use:TimeZone tz = tzRegistry.getTimeZone(zoneid.getId());
VTimeZone vtz = tz.getVTimeZone(); I haven't fully tested this code but should be something like that.. |
Beta Was this translation helpful? Give feedback.
To get a VTIMEZONE from a date property with iCal4j 4.x you first need to get the
ZoneId
and use it to look up the timezone registry.With iCal4j 3.x this lookup was encapsulated in
DtStart#getTimeZone
, but has been decoupled to support the new date/time API.To get the zone id use:
To get the VTIMEZONE use: