ZF-7912: Bug introduced in Zend Date 18093 following ZF-7833 correction.

Issue Type: Sub-task Created: 2009-09-21T08:55:59.000+0000 Last Updated: 2009-09-30T13:46:43.000+0000 Status: Resolved Fix version(s): - 1.10.0 (27/Jan/10)

Reporter: thomas (thomas963) Assignee: Thomas Weidner (thomas) Tags: - Zend_Date

Related issues: Attachments:


But in 1.7.8 and earlier version, the get method take into account the option format_type. So 1.78 and earlier was wrong. It is a strong change wich should be mentionned in documentation for migration. As all people working with zend_date in php format in 1.7.8 will have to migrate code for 1.8+ versions.

New problem: I find a new bug, wich appear only with the Date.php available in the trunk directory (version Id: Date.php 18093 2009-09-13 11:35:01Z thomas) with the patch you have done for my previous problem. With the original 1.9.2 Date.php, this bug in not here, so I guess it comes from your modifications.

IsLater and IsEarlier method for zend_date object send strange return value. Exemple:

Zend_Loader::loadClass('Zend_Date'); Zend_Date::setOptions(array('format_type' => 'php')); // This bug appears only when php format is actived, with the trunck Date.php version Id: Date.php 18093 2009-09-13 11:35:01Z thomas $date1 = new Zend_Date(); $date2 = clone $date1; $date2->add(1, Zend_Date::DAY);

echo "Is date1 earlier than date2:".$date1->isEarlier($date2, Zend_Date::DATES)."
"; // return false echo "Is date2 earlier than date1:".$date2->isEarlier($date1, Zend_Date::DATES)."
"; // return false echo "Is date1 later than date2:".$date1->isLater($date2, Zend_Date::DATES)."
"; // return true echo "Is date2 later than que date1:".$date2->isLater($date1, Zend_Date::DATES)."
"; // return true

Results are not possible. So maybe you need to check better the correction made previously as it impacts "isEarlier" and "isLater" method which rely on "compare" / "_calculate" methods.

Thanks again. Cheers, Thomas.


Posted by Thomas Weidner (thomas) on 2009-09-30T13:46:37.000+0000

Closing as non-issue.

Note that Zend_Date's constants are using ISO notation. When you set Zend_Date to use GNU notation, you can no longer use Zend_Date's constants but must set formats manually.

There is no benefit to set GNU format but use ISO instead (would be nonsense).

A warning has been added to the manual.

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.