Skip to content
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

Using RRULE[WKST] and a default first day of week #67

Closed
jeromecombes opened this issue Jul 7, 2016 · 1 comment
Closed

Using RRULE[WKST] and a default first day of week #67

jeromecombes opened this issue Jul 7, 2016 · 1 comment

Comments

@jeromecombes
Copy link
Contributor

jeromecombes commented Jul 7, 2016

I use French calendars and weeks start on Mondays, not on Sundays.
If we don't set the correct first day of week, we can have some bad results with recurrences.
I offer to update the class so that we can provide a default first day of week.
The class might also adapt the result depending on the RRULE[WKST] parameter.

From http://www.kanzaki.com/docs/ical/rrule.html :
An example where the days generated makes a difference because of

WKST:
  DTSTART;TZID=US-Eastern:19970805T090000
  RRULE:FREQ=WEEKLY;INTERVAL=2;COUNT=4;BYDAY=TU,SU;WKST=MO
  ==> (1997 EDT)Aug 5,10,19,24

changing only WKST from MO to SU, yields different results...

DTSTART;TZID=US-Eastern:19970805T090000
  RRULE:FREQ=WEEKLY;INTERVAL=2;COUNT=4;BYDAY=TU,SU;WKST=SU
  ==> (1997 EDT)August 5,17,19,31

My ICS example (the only difference between the 2 events is the WKST parameter) :

BEGIN:VEVENT
DTSTART;TZID=Europe/Paris:20160705T090000
DTEND;TZID=Europe/Paris:20160705T100000
RRULE:FREQ=WEEKLY;INTERVAL=2;COUNT=4;BYDAY=TU,SU;WKST=MO
DTSTAMP:20160514T170815Z
UID:tl6n0s54hq71d0hg3fm4zzzzt0@google.com
CREATED:20150624T141227Z
DESCRIPTION:
LAST-MODIFIED:20160707T075813Z
LOCATION:
SEQUENCE:1
STATUS:CONFIRMED
SUMMARY:TEST WKST MO
TRANSP:OPAQUE
END:VEVENT
BEGIN:VEVENT
DTSTART;TZID=Europe/Paris:20160705T090000
DTEND;TZID=Europe/Paris:20160705T100000
RRULE:FREQ=WEEKLY;INTERVAL=2;COUNT=4;BYDAY=TU,SU;WKST=SU
DTSTAMP:20160514T170815Z
UID:tl6n0s54hq71d0hg3fmssszzt0@google.com
CREATED:20150624T141227Z
DESCRIPTION:
LAST-MODIFIED:20160707T075813Z
LOCATION:
SEQUENCE:1
STATUS:CONFIRMED
SUMMARY:TEST WKST SU
TRANSP:OPAQUE
END:VEVENT
@u01jmg3
Copy link
Owner

u01jmg3 commented Aug 21, 2016

Fixed by PR #70

@u01jmg3 u01jmg3 closed this as completed Aug 21, 2016
@u01jmg3 u01jmg3 removed their assignment Aug 21, 2016
@u01jmg3 u01jmg3 added the v1.x.x label Aug 21, 2016
@u01jmg3 u01jmg3 modified the milestone: v1.x.x Sep 5, 2016
@u01jmg3 u01jmg3 removed the v1.x.x label Sep 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants