[dev] [cvs] commit: framework/Date/Date Recurrence.php

Michael Rubinsky mrubinsk at horde.org
Sun Oct 19 19:16:05 UTC 2008


Quoting Jan Schneider <jan at horde.org>:

> Zitat von Michael Rubinsky <mike at theupstairsroom.com>:
>
>> mrubinsk    2008-10-18 16:40:49 EDT
>>
>>  Modified files:
>>    Date/Date            Recurrence.php
>>  Log:
>>  Check that the ISO-8601 week number is NOT the first week of the year while
>>  we are in month 12. If it IS, then we need to bump the year up one before
>>  calculating the after_week value.
>>
>>  This fixes an infinite loop with certain recurring events.
>>
>>  Revision  Changes    Path
>>  1.24      +11 -3     framework/Date/Date/Recurrence.php
>>
>>  Chora Links:
>>   
>> http://cvs.horde.org/diff.php/framework/Date/Date/Recurrence.php?r1=1.23&r2=1.24&ty=u
>>
>> --
>> To unsubscribe, mail: cvs-unsubscribe at lists.horde.org
>>
>
> Shouldn't we increment $after->year directly instead?

No, because $after is used later in the function where it is compared  
with $next. Incrementing $after->year would make $after represent the  
wrong date in that comparison. We don't want to increase the $after  
date by a year, we just want to make sure that when we calculate the  
week number of the year and use that value to create a new Horde_Date,  
that if we are in that last/first week that spans the year boundary  
that we use the correct year in building the new date object.


Thanks,
mike

--
The Horde Project (www.horde.org)
mrubinsk at horde.org

"Time just hates me. That's why it made me an adult." - Josh Joplin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: PGP Digital Signature
URL: <http://lists.horde.org/archives/dev/attachments/20081019/17c66c23/attachment.bin>


More information about the dev mailing list