-
Notifications
You must be signed in to change notification settings - Fork 44
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
Disable Zulu time when timezones specified #20
Comments
Nick, Adding a timezone ID parameter to a property will NOT cause it to be formatted in that timezone. To format a property in a specific timezone, you have to use the writer's ICalendar ical = new ICalendar();
VEvent event = new VEvent();
DateStart dtstart = ...
event.setProperty(dtstart);
DateEnd dtend = ...
event.setProperty(dtend);
ical.addEvent(event);
ICalWriter writer = ...
VTimezone vtimezone = ...
TimeZone timezone = TimeZone.getTimeZone(...);
writer.getTimezoneInfo.assign(vtimezone, timezone);
writer.getTimezoneInfo().setTimeZone(dtstart, timezone);
writer.getTimezoneInfo().setTimeZone(dtend, timezone);
writer.write(ical); As it stands now, there's no way to assign a timezone to an event as a whole. You have to individually assign each of the event's date/time properties to the timezone. But maybe I will add this feature. Thanks for the idea! |
Mike, Ah! thanks for the info. Will try that. Will look into a PR to support this Cheers, Nick |
Closing. See #36 |
I have multiple
VTIMEZONE
objects specified in my calendar, all of which are being used byVEVENTS
. I do not want to specify a timezone for the calendar as a whole, but rather on individual events.Perhaps I am mistaken, but it seems as though specifying a timezone property on a
VEvent
object should cause it to be serialized without a Zulu time. An example, using Scala but should work same in Java:There is mention in the "Working with Timezones" page about using
icalWriter.getTimezoneInfo().setDefaultTimeZone(tz);
to set timezones for the calendar as a whole. I do not need to specify a global timezone as all events have a timezone specified, however if that is the best solution I could specify a bunk timezone to prevent the Zulu time specification.Hope this makes sense, happy to provide more clarification
The text was updated successfully, but these errors were encountered: