ixc/glamkit-eventtools — pull request #5 by taivo (2012-09-24 22:46:28+00:00)
Title: fixed formula to calculate n in rule.get_rrule. example: sept 7, 2012 sh...

Hello,
I fixed the formula to calculate n (for complex rules %nthday%) to ```n = 1 + (d.day-1)/7```. Minus 1 is needed because we want the number of days to the first day of the month, not the first day of the month itself.

The original formula ```n = 1 + (d.day / 7)``` works correctly for most cases except when d.day is a multiple of 7. For example, September 7, 2012 is the first Friday of the month so n should be 1 instead of 2. The new formula should work for all cases.

:)