GithubHelp home page GithubHelp logo

Comments (3)

dmedvinsky avatar dmedvinsky commented on June 1, 2024

Seems like an issue after icalendar update, because I couldn't reproduce it with icalendar==3.8.4 but was able to with icalendar==3.9.0.

from mutt-ics.

j-valdes avatar j-valdes commented on June 1, 2024

I've encountered this exact problem also when using icalendar 3.9.0 to view events generated by Exchange 2010. The issue seems to be triggered by the fact that the day given by the date-time value for DTSTART doesn't match a day given by the RRULE in each of the STANDARD and DAYLIGHT sub-components of the VTIMEZONE component. In the OP's example, DTSTART in both sub-components is set to 16010101T020000, Jan 1, 1601, which was a Thursday, but the RRULE in the STANDARD sub-component indicates that the switch to standard time happens on the 1st Sunday of November (BYDAY=1SU;BYMONTH=11) while the RRULE in the DAYLIGHT sub-component indicates that the switch to daylight time happens on the 2nd Sunday of March (BYDAY=2SU;BYMONTH=3), neither of which is a Thu in Jan. If the DTSTART value in each sub-component is changed to a date that matches the corresponding RRULE, eg, to DTSTART:20071104T020000 (Sun, Nov 4, 2007) for STANDARD and DTSTART:20070311T020000 (Sun, Mar 11, 2007) for DAYLIGHT, then icalendar properly parses (and presumedly uses) the timezone dst rules.

I'm not sure where the bug lies here (with Exchange for setting incorrect DTSTART date-times or icalendar for not being more lax when combining DTSTART values with RRULEs in VTIMEZONE--from my quick read of RFC 2445 and in particular section 4.8.5.4, the DTSTART value should/must indicate (ie, match) the first instance of a recurrence rule--but if one doesn't want to strip out the VTIMEZONE section of an event in the ICS file, another workaround is to correct the DTSTART values in VTIMEZONE to match the RRULEs. Since this bug isn't in mutt-ics, in principle it is best fixed/worked-around outside of mutt-ics (eg, using a pipeline in one's .mailcap like the OP did). However, since mutt-ics already has a workaround in get_ics_text() for Exchange events, that can be easily expanded to:

--- mutt-ics.dist   2015-07-03 12:10:00.000000000 -0500
+++ mutt-ics    2015-07-03 14:37:24.000000000 -0500
@@ -42,7 +42,8 @@
     # Ugly workaround: Python datetime doesn't support dates earlier than 1900,
     # whilst Microsoft corp. has created it's Exchange Sever 2007 somewhere in
     # the beginning of XVII century. Yeah, right.
-    ics_text = content.replace("\nDTSTART:1601", "\nDTSTART:1901")
+    ics_text = content.replace("STANDARD\nDTSTART:16010101", "STANDARD\nDTSTART:20071104")
+    ics_text = content.replace("DAYLIGHT\nDTSTART:16010101", "DAYLIGHT\nDTSTART:20070311")
     return ics_text

at least for US timezones. A more general workaround for any timezone would probably require parsing the RRULE and figuring out which dates in the current year match an instance of the RRULE.

from mutt-ics.

dmedvinsky avatar dmedvinsky commented on June 1, 2024

Even though nobody likes workarounds, I'm being pragmatic here and included your fix. Thanks @j-valdes!

from mutt-ics.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.