There might be 53 weeks in the (ISO-8601) year.
authorMichael J. Rubinsky <mrubinsk@horde.org>
Mon, 9 Aug 2010 21:52:08 +0000 (17:52 -0400)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Mon, 9 Aug 2010 21:52:08 +0000 (17:52 -0400)
framework/Date/lib/Horde/Date/Recurrence.php

index 86476e3..5bc2874 100644 (file)
@@ -391,7 +391,7 @@ class Horde_Date_Recurrence
             $week = $after->format('W');
             if ($week == 1 && $after->month == 12) {
                 $theYear = $after->year + 1;
-            } elseif ($week == 52 && $after->month == 1) {
+            } elseif ($week >= 52 && $after->month == 1) {
                 $theYear = $after->year - 1;
             } else {
                 $theYear = $after->year;