Hi guys,
Having a little confusion over the use of the equals function for zend_date.
It seems like it should be pretty straightforward. I'm mainly utilizing the
function with a calendar implementation. So I basically have two zend_date
objects, created from mysql datetime fields. The times will be different,
so I want to grab just the year, month, day values from the objects and
compare them. If I do something like:
$date 1 = new Zend_Date('a date', Zend_Date::ISO_8601);
$date 2 = new Zend_Date('b date', Zend_Date::ISO_8601);
Zend_Debug::dump($date1->equals($date2, 'YYYY-MM-dd');
Given that the two date objects, year, month, day values are the same, this
dump will return false. Which doesn't makes sense as the reference guide
says:
returns true, if $part of $date having locale $locale is the same as this
object's date $part, otherwise false
Is this the wrong use? Does $part have to be a zend_date constant? And if
so, can I tie multiple constants together to build a date of 'YYYY-MM-dd'?
Thanks,
Aztechy
--
View this message in context:
http://www.nabble.com/Zend-Date-Comparison-with-equals-tp20063705p20063705.html
Sent from the Zend Framework mailing list archive at Nabble.com.