Important: Unexpected recurrence instances returned
I am trying to create an event that occurs every wednesday forever. I use following RRULEs but I am getting different results. Both use cases had the same first DTSTART: 20171026T030000Z Case 1 (Correct/Expected): RRULE:FREQ=WEEKLY;WKST=SU RECURRENCE-ID: 20171102T030000Z, 20171109T030000Z, 20171116T030000Z, 20171123T030000Z ----------------------------------------------------------- Case 2 (Off by 1 day): RRULE:FREQ=WEEKLY;BYDAY=WE;WKST=SU RECURRENCE-ID: 20171101T030000Z, 20171108T030000Z, 20171115T030000Z, 20171122T030000Z Please note the results in second case are off by 1 day. What could be wrong? Best Regards,
I tried without WKST as well. RRULE with BYDAY is still off by 1 day. But RRULE without BYDAY returns correct results. I also tried RRULE:FREQ=WEEKLY;INTERVAL=2. On Wed, Oct 25, 2017 at 7:57 PM, Gaurav Jain <monkeyfdude@gmail.com> wrote:
I am trying to create an event that occurs every wednesday forever. I use following RRULEs but I am getting different results.
Both use cases had the same first DTSTART: 20171026T030000Z
Case 1 (Correct/Expected):
RRULE:FREQ=WEEKLY;WKST=SU
RECURRENCE-ID: 20171102T030000Z, 20171109T030000Z, 20171116T030000Z, 20171123T030000Z
-----------------------------------------------------------
Case 2 (Off by 1 day):
RRULE:FREQ=WEEKLY;BYDAY=WE;WKST=SU
RECURRENCE-ID: 20171101T030000Z, 20171108T030000Z, 20171115T030000Z, 20171122T030000Z
Please note the results in second case are off by 1 day.
What could be wrong?
Best Regards,
Hi Gaurav, --On October 25, 2017 at 7:57:46 PM -0700 Gaurav Jain <monkeyfdude@gmail.com> wrote:
I am trying to create an event that occurs every wednesday forever. I use following RRULEs but I am getting different results.
Both use cases had the same first DTSTART: 20171026T030000Z
Case 1 (Correct/Expected):
RRULE:FREQ=WEEKLY;WKST=SU
RECURRENCE-ID: 20171102T030000Z, 20171109T030000Z, 20171116T030000Z, 20171123T030000Z
-----------------------------------------------------------
Case 2 (Off by 1 day):
RRULE:FREQ=WEEKLY;BYDAY=WE;WKST=SU
RECURRENCE-ID: 20171101T030000Z, 20171108T030000Z, 20171115T030000Z, 20171122T030000Z
Please note the results in second case are off by 1 day.
What could be wrong?
Can you please attach the full iCalendar data for both these events - in particular the DTSTART value is crucial in determining how the RRULE operates. -- Cyrus Daboo
I think I found the problem and solution. I was sending DTSTART:20171026T030000Z - as UTC time But then I read The "DTSTART <https://www.kanzaki.com/docs/ical/dtstart.html>" and "DTEND <https://www.kanzaki.com/docs/ical/dtend.html>" property pair or "DTSTART <https://www.kanzaki.com/docs/ical/dtstart.html>" and " <https://www.kanzaki.com/docs/ical/duration.html>DURATION <https://www.kanzaki.com/docs/ical/duration-t.html>" property pair, specified within the iCalendar object defines the first instance of the recurrence. When used with a recurrence rule, the "DTSTART <https://www.kanzaki.com/docs/ical/dtstart.html>" and "DTEND <https://www.kanzaki.com/docs/ical/dtend.html>" properties MUST be specified in local time and the appropriate set of "VTIMEZONE <https://www.kanzaki.com/docs/ical/vtimezone.html>" calendar components MUST be included. For detail on the usage of the "VTIMEZONE <https://www.kanzaki.com/docs/ical/vtimezone.html>" calendar component, see the "VTIMEZONE <https://www.kanzaki.com/docs/ical/vtimezone.html>" calendar component definition. When I send DTSTART;TZID=America/Los_Angeles:20171026T030000, it works. I have a different question, is it necessary to send VTIMEZONE within the iCalendar object for recurrence to work? After the above changes, it works even if there is no VTIMEZONE in iCalendar object. On Thu, Oct 26, 2017 at 6:53 AM, Cyrus Daboo <cdaboo@apple.com> wrote:
Hi Gaurav,
--On October 25, 2017 at 7:57:46 PM -0700 Gaurav Jain < monkeyfdude@gmail.com> wrote:
I am trying to create an event that occurs every wednesday forever. I use
following RRULEs but I am getting different results.
Both use cases had the same first DTSTART: 20171026T030000Z
Case 1 (Correct/Expected):
RRULE:FREQ=WEEKLY;WKST=SU
RECURRENCE-ID: 20171102T030000Z, 20171109T030000Z, 20171116T030000Z, 20171123T030000Z
-----------------------------------------------------------
Case 2 (Off by 1 day):
RRULE:FREQ=WEEKLY;BYDAY=WE;WKST=SU
RECURRENCE-ID: 20171101T030000Z, 20171108T030000Z, 20171115T030000Z, 20171122T030000Z
Please note the results in second case are off by 1 day.
What could be wrong?
Can you please attach the full iCalendar data for both these events - in particular the DTSTART value is crucial in determining how the RRULE operates.
-- Cyrus Daboo
Hi Gaurav, --On October 26, 2017 at 12:40:56 PM -0700 Gaurav Jain <monkeyfdude@gmail.com> wrote:
When I send DTSTART;TZID=America/Los_Angeles:20171026T030000, it works.
OK, I was thinking it might be related to the time zone used with DTSTART.
I have a different question, is it necessary to send VTIMEZONE within the iCalendar object for recurrence to work?
After the above changes, it works even if there is no VTIMEZONE in iCalendar object.
Most iCalendar servers and client now support iCalendardata without a VTIMEZONE assuming the time zone id being used is one of the standard IANA time zones. If you are sending the iCalendar data to an "unknown" system (e.g. via email) then it is safer to always include the VTIMEZONE. -- Cyrus Daboo
participants (2)
-
Cyrus Daboo
-
Gaurav Jain