Zend Framework

compareDate extracts false date

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.8.4
  • Fix Version/s: 1.10.0
  • Component/s: Zend_Date
  • Labels:
    None

Description

We´d like to compare two dates with Zend_Date method compareDate. compareDate calls the _date method. This method extracts a date with the format ‚d.M.Y' when an instance of Zend_Date is given. The problem is, this extraction makes for the overgiven date 01.01.2010 the date 1.1.2009.

$dateValue = new Zend_Date(‚01.01.2010');
$today = new Zend_Date();
$tomorrow = $today->addDay(1);

$tomorrow->compareDate($dateValue)	// results 1, when -1 expected

Activity

Hide
Thomas Weidner added a comment -

Example not reproducable as it produces a tokenizer error.

Show
Thomas Weidner added a comment - Example not reproducable as it produces a tokenizer error.
Hide
Thomas Weidner added a comment -

Fixed with r18661

Show
Thomas Weidner added a comment - Fixed with r18661

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: