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?

CommentFileSizeAuthor
date_repeat_calc-5.x-2.5-february.patch914 bytesaasarava

Comments

ericm’s picture

There appear to be four issue threads all with the same problem; the one you noted. See: #369020: "Every First Saturday" skips Feb, March

karens’s picture

Status: Needs work » Closed (duplicate)

This 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.

baff’s picture

ignore