dday ical and google calendar until problems

1.9k views Asked by At

Hi I have this ical (1.0 beta)

I have this code

IICalendarCollection iCal = iCalendar.LoadFromStream(fileStream); 
foreach (var ic in iCal) 
{ 
    foreach (var evt in ic.Events)
    { 
        DateTime now = DateTime.UtcNow.Date; 
        if (evt.Start.UTC.Date.CompareTo(now) >= 0 && evt.End.UTC.Date.CompareTo(now) >= 0) 
        { 
            foreach (var rule in evt.RecurrenceRules) 
            { 
                if (rule.Frequency == FrequencyType.Daily) 
                { 
                    // always false until is never set. 
                    bool doesRepeatingEnd = DoesRepeatingEnd(rule); 
                    if (doesRepeatingEnd) 
                    {
                        TimeSpan until = now.Subtract(rule.Until); 
                        int days = until.Days; 
                    } 
                    else { }    
                } else if (rule.Frequency == FrequencyType.Weekly) 
                { 
                } 
                else if (rule.Frequency == FrequencyType.Monthly) 
                { 
                } 
                else if (rule.Frequency == FrequencyType.Yearly) 
                { 
                }

            } 
    }   } 
}


        private static bool DoesRepeatingEnd(IRecurrencePattern rule) 
        { 
            DateTime until = rule.Until; 
            return until != DateTime.MinValue; 
        }

I import a google calendar in(ical format)

BEGIN:VCALENDAR 
PRODID:-//Google Inc//Google Calendar 70.9054//EN 
VERSION:2.0 
CALSCALE:GREGORIAN 
METHOD:PUBLISH 
X-WR-CALNAME:
 Name X-WR-TIMEZONE:America/Washington 
 BEGIN:VTIMEZONE 
 TZID:America/Washington 
 X-LIC-LOCATION:America/Washington 
 BEGIN:DAYLIGHT 
 TZOFFSETFROM:-0800 
 TZOFFSETTO:-0700 
 TZNAME:PDT 
 DTSTART:19700308T020000
 RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=2SU 
 END:DAYLIGHT
 BEGIN:STANDARD 
 TZOFFSETFROM:-0700 
 TZOFFSETTO:-0800 
 TZNAME:PST 
 DTSTART:19701101T020000 
 RRULE:FREQ=YEARLY;BYMONTH=11;BYDAY=1SU 
 END:STANDARD 
 END:VTIMEZONE 
 BEGIN:VEVENT 
 DTSTART;VALUE=DATE:20110530 
 DTEND;VALUE=DATE:20110531 
 RRULE:FREQ=DAILY;UNTIL=20110604 
 DTSTAMP:20110424T202756Z 
 UID:[email protected] 
 CREATED:20110424T202406Z 
 DESCRIPTION: 
 LAST-MODIFIED:20110424T202406Z 
 LOCATION: 
 SEQUENCE:0 
 STATUS:CONFIRMED 
 SUMMARY:dd 
 TRANSP:TRANSPARENT 
 END:VEVENT 
 END:VCALENDAR

as you can see I have RRULE:FREQ=DAILY;UNTIL=20110604 but my code never picks it up rule.Until is always like the default datetime.

Anyone have any ideas?

Thanks

1

There are 1 answers

0
chobo2 On BEST ANSWER

This is a bug in the current version of dday ical and will be fixed in future versions

Google Repeating Task Until Time Bug