ZF-12010: Zend_Date isLater doesn't work properly when using yyyy-MM-dd as $part


If i do this:

$a=new Zend_Date(); $b=clone $a;

and this: $a->isLater($b,'yyyy-MM-dd')

I should get a false value, insted I get a TRUE value.

If i use: $a->isLater($b,Zend_Date::DATES)

I get the correct value (false).


I think this is correct behavier.

In the comparison from date $b only year, month and days are considered (so hours, minutes, seconds are 0) and so it is before date $a where hours, minutes and seconds or at least one of it are greater than 0, so $a is later than $b and the comparison is correct.

You have to specify one of the recognized date constants as the second argument to {{isLater}}. More information is available in the Comparing Dates section of the manual.