I've found a bug in the date repeat calculation that causes February 2009 to be skipped when you set a date to repeat "every month" on the "last Saturday." (It's also skipped when you set it "last Fri" or "last Thurs".)
It seems that the bug is due to the way PHP5.2's date_modify() function handles a "+1 month" calculation. See this posting at php.net for more information:
http://php.net/manual/en/function.date-modify.php#87978
The call to date_modify() in question is at line 234 in date_repeat_calc.inc. I'm attaching a patch that shows my workaround -- which is basically to check to make sure that a +1 month doesn't modify the date beyond one actual month. Not sure if this is the best way to handle the problem, though, or if it will cause any unintended consequences. Can someone please help check?
| Comment | File | Size | Author |
|---|---|---|---|
| date_repeat_calc-5.x-2.5-february.patch | 914 bytes | aasarava |
Comments
Comment #1
ericm commentedThere appear to be four issue threads all with the same problem; the one you noted. See: #369020: "Every First Saturday" skips Feb, March
Comment #2
karens commentedThis is apparently the same problem as #369020: "Every First Saturday" skips Feb, March (this part of the code is the same in the D5 and D6 versions. Let's consolidate on that issue.
Comment #3
baff commentedignore