[dev] [cvs] commit: framework/Date/Date Recurrence.php
Jan Schneider
jan at horde.org
Mon Jul 7 11:04:35 UTC 2008
Zitat von Gunnar Wrobel <wrobel at pardus.de>:
> Jan Schneider <jan at horde.org> writes:
>
>> Zitat von Gunnar Wrobel <wrobel at pardus.de>:
>>
>>> Jan Schneider <jan at horde.org> writes:
>>>
>>>> Zitat von Gunnar Wrobel <p at rdus.de>:
>>>>
>>>>> wrobel 2008-07-07 00:40:07 EDT
>>>>>
>>>>> Modified files:
>>>>> Date/Date Recurrence.php
>>>>> Log:
>>>>> Add a function to return the next active recurrence.
>>>>>
>>>>> Revision Changes Path
>>>>> 1.15 +26 -1 framework/Date/Date/Recurrence.php
>>>>
>>>> Why not having nextRecurrence() do this?
>>>
>>> You mean with an additional flag like "$active = false" in the
>>> function call? Sure, should also work. Having the while loop in
>>> nextActiveRecurrence() seemed appropriate to me but I'm not
>>> particularly attached to solving it like that.
>>
>> No, I think nextRecurrence() should unconditionally skip any complete
>> recurrences, just like it skips exceptions now.
>
> Now I'm confused. You are referring to nextRecurrence() in
> framework/Date/Date/Recurrence.php?
>
> I don't see that the code would automatically skip exceptions. We use
> structures like
>
> if ($next = $event->recurrence->nextRecurrence($date)) {
> if ($event->recurrence->hasException($next->year, $next->month,
> $next->mday)) {
> ...
>
> in several code sections which is the main reason for
> nextActiveRecurrence(). Or did I misunderstand something?
No, you are absolutely correct. *I* am confused, sorry about the noise. :)
Jan.
--
Do you need professional PHP or Horde consulting?
http://horde.org/consulting/
More information about the dev
mailing list