Zend Framework

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

Details

  • Type: Sub-task Sub-task
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Not an Issue
  • Affects Version/s: 1.10.0
  • Fix Version/s: 1.10.0
  • Component/s: Zend_Date
  • Labels:
    None

Description

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)."<br>"; // return false
echo "Is date2 earlier than date1:".$date2->isEarlier($date1, Zend_Date::DATES)."<br>"; // return false
echo "Is date1 later than date2:".$date1->isLater($date2, Zend_Date::DATES)."<br>"; // return true
echo "Is date2 later than que date1:".$date2->isLater($date1, Zend_Date::DATES)."<br>"; // 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.

Activity

Hide
Thomas Weidner added a comment -

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.

Show
Thomas Weidner added a comment - 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.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: