Simplifying the TimeZone portion of the calendar

Help
R. Seifert
2013-10-23
2013-10-23
  • R. Seifert
    R. Seifert
    2013-10-23

    Hello,

    I am attempting to add a timezone component to a calendar so that the output looks like the following:
    ...
    BEGIN:VTIMEZONE
    TZID:America/New_York
    BEGIN:STANDARD
    DTSTART:19710101T020000
    TZOFFSETTO:-0500
    TZOFFSETFROM:-0400
    RRULE:FREQ=YEARLY;WKST=MO;INTERVAL=1;BYMONTH=11;BYDAY=1SU
    TZNAME:EST
    END:STANDARD
    BEGIN:DAYLIGHT
    DTSTART:19710101T020000
    TZOFFSETTO:-0400
    TZOFFSETFROM:-0500
    RRULE:FREQ=YEARLY;WKST=MO;INTERVAL=1;BYMONTH=3;BYDAY=2SU
    TZNAME:EDT
    END:DAYLIGHT
    END:VTIMEZONE
    ...

    I am using the following to try this:

    ...
    TimeZoneRegistry registry = new TimeZoneRegistryImpl("zoneinfo-outlook-global/")
    TimeZone timezone = params.timezone ? registry.getTimeZone(params.timezone) :      registry.getTimeZone('America/New_York')
    VTimeZone tz = timezone.vTimeZone
    ...
    cal.getComponents().add(tz)
    

    What I get is this very long version of the VTIMEZONE:
    BEGIN:VTIMEZONE
    TZID:America/New_York
    TZURL:http://tzurl.org/zoneinfo/America/New_York
    X-LIC-LOCATION:America/New_York
    BEGIN:DAYLIGHT
    TZOFFSETFROM:-0500
    TZOFFSETTO:-0400
    TZNAME:EDT
    DTSTART:20070311T020000
    RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=2SU
    END:DAYLIGHT
    BEGIN:STANDARD
    TZOFFSETFROM:-0400
    TZOFFSETTO:-0500
    TZNAME:EST
    DTSTART:20071104T020000
    RRULE:FREQ=YEARLY;BYMONTH=11;BYDAY=1SU
    END:STANDARD
    BEGIN:STANDARD
    TZOFFSETFROM:-045602
    TZOFFSETTO:-0500
    TZNAME:EST
    DTSTART:18831118T120358
    RDATE:18831118T120358
    END:STANDARD
    BEGIN:DAYLIGHT
    TZOFFSETFROM:-0500
    TZOFFSETTO:-0400
    TZNAME:EDT
    DTSTART:19180331T020000
    RDATE:19180331T020000
    RDATE:19190330T020000
    RDATE:19200328T020000
    RDATE:19210424T020000
    RDATE:19220430T020000
    RDATE:19230429T020000
    RDATE:19240427T020000
    RDATE:19250426T020000
    RDATE:19260425T020000
    RDATE:19270424T020000
    RDATE:19280429T020000
    RDATE:19290428T020000
    RDATE:19300427T020000
    RDATE:19310426T020000
    RDATE:19320424T020000
    RDATE:19330430T020000
    RDATE:19340429T020000
    RDATE:19350428T020000
    RDATE:19360426T020000
    RDATE:19370425T020000
    RDATE:19380424T020000
    RDATE:19390430T020000
    RDATE:19400428T020000
    RDATE:19410427T020000
    RDATE:19460428T020000
    RDATE:19470427T020000
    RDATE:19480425T020000
    RDATE:19490424T020000
    RDATE:19500430T020000
    RDATE:19510429T020000
    RDATE:19520427T020000
    RDATE:19530426T020000
    RDATE:19540425T020000
    RDATE:19550424T020000
    RDATE:19560429T020000
    RDATE:19570428T020000
    RDATE:19580427T020000
    RDATE:19590426T020000
    RDATE:19600424T020000
    RDATE:19610430T020000
    RDATE:19620429T020000
    RDATE:19630428T020000
    RDATE:19640426T020000
    RDATE:19650425T020000
    RDATE:19660424T020000
    RDATE:19670430T020000
    RDATE:19680428T020000
    RDATE:19690427T020000
    RDATE:19700426T020000
    RDATE:19710425T020000
    RDATE:19720430T020000
    RDATE:19730429T020000
    RDATE:19740106T020000
    RDATE:19750223T020000
    RDATE:19760425T020000
    RDATE:19770424T020000
    RDATE:19780430T020000
    RDATE:19790429T020000
    RDATE:19800427T020000
    RDATE:19810426T020000
    RDATE:19820425T020000
    RDATE:19830424T020000
    RDATE:19840429T020000
    RDATE:19850428T020000
    RDATE:19860427T020000
    RDATE:19870405T020000
    RDATE:19880403T020000
    RDATE:19890402T020000
    RDATE:19900401T020000
    RDATE:19910407T020000
    RDATE:19920405T020000
    RDATE:19930404T020000
    RDATE:19940403T020000
    RDATE:19950402T020000
    RDATE:19960407T020000
    RDATE:19970406T020000
    RDATE:19980405T020000
    RDATE:19990404T020000
    RDATE:20000402T020000
    RDATE:20010401T020000
    RDATE:20020407T020000
    RDATE:20030406T020000
    RDATE:20040404T020000
    RDATE:20050403T020000
    RDATE:20060402T020000
    END:DAYLIGHT
    BEGIN:STANDARD
    TZOFFSETFROM:-0400
    TZOFFSETTO:-0500
    TZNAME:EST
    DTSTART:19181027T020000
    RDATE:19181027T020000
    RDATE:19191026T020000
    RDATE:19201031T020000
    RDATE:19210925T020000
    RDATE:19220924T020000
    RDATE:19230930T020000
    RDATE:19240928T020000
    RDATE:19250927T020000
    RDATE:19260926T020000
    RDATE:19270925T020000
    RDATE:19280930T020000
    RDATE:19290929T020000
    RDATE:19300928T020000
    RDATE:19310927T020000
    RDATE:19320925T020000
    RDATE:19330924T020000
    RDATE:19340930T020000
    RDATE:19350929T020000
    RDATE:19360927T020000
    RDATE:19370926T020000
    RDATE:19380925T020000
    RDATE:19390924T020000
    RDATE:19400929T020000
    RDATE:19410928T020000
    RDATE:19450930T020000
    RDATE:19460929T020000
    RDATE:19470928T020000
    RDATE:19480926T020000
    RDATE:19490925T020000
    RDATE:19500924T020000
    RDATE:19510930T020000
    RDATE:19520928T020000
    RDATE:19530927T020000
    RDATE:19540926T020000
    RDATE:19551030T020000
    RDATE:19561028T020000
    RDATE:19571027T020000
    RDATE:19581026T020000
    RDATE:19591025T020000
    RDATE:19601030T020000
    RDATE:19611029T020000
    RDATE:19621028T020000
    RDATE:19631027T020000
    RDATE:19641025T020000
    RDATE:19651031T020000
    RDATE:19661030T020000
    RDATE:19671029T020000
    RDATE:19681027T020000
    RDATE:19691026T020000
    RDATE:19701025T020000
    RDATE:19711031T020000
    RDATE:19721029T020000
    RDATE:19731028T020000
    RDATE:19741027T020000
    RDATE:19751026T020000
    RDATE:19761031T020000
    RDATE:19771030T020000
    RDATE:19781029T020000
    RDATE:19791028T020000
    RDATE:19801026T020000
    RDATE:19811025T020000
    RDATE:19821031T020000
    RDATE:19831030T020000
    RDATE:19841028T020000
    RDATE:19851027T020000
    RDATE:19861026T020000
    RDATE:19871025T020000
    RDATE:19881030T020000
    RDATE:19891029T020000
    RDATE:19901028T020000
    RDATE:19911027T020000
    RDATE:19921025T020000
    RDATE:19931031T020000
    RDATE:19941030T020000
    RDATE:19951029T020000
    RDATE:19961027T020000
    RDATE:19971026T020000
    RDATE:19981025T020000
    RDATE:19991031T020000
    RDATE:20001029T020000
    RDATE:20011028T020000
    RDATE:20021027T020000
    RDATE:20031026T020000
    RDATE:20041031T020000
    RDATE:20051030T020000
    RDATE:20061029T020000
    END:STANDARD
    BEGIN:STANDARD
    TZOFFSETFROM:-0500
    TZOFFSETTO:-0500
    TZNAME:EST
    DTSTART:19200101T000000
    RDATE:19200101T000000
    RDATE:19420101T000000
    RDATE:19460101T000000
    RDATE:19670101T000000
    END:STANDARD
    BEGIN:DAYLIGHT
    TZOFFSETFROM:-0500
    TZOFFSETTO:-0400
    TZNAME:EWT
    DTSTART:19420209T020000
    RDATE:19420209T020000
    END:DAYLIGHT
    BEGIN:DAYLIGHT
    TZOFFSETFROM:-0400
    TZOFFSETTO:-0400
    TZNAME:EPT
    DTSTART:19450814T190000
    RDATE:19450814T190000
    END:DAYLIGHT
    END:VTIMEZONE

    How do I simplify this VTIMEZONE?

     
    • Erich Bremer
      Erich Bremer
      2013-10-23

      Please send all e-mail for me to erich.bremer@stonybrook.edu