zendframework / zf1

This project reached its end-of-life on 2016-09-28. Contains conversion of ZF1 subversion repo to git, from version 15234 forward, and only containing master and release-1.12 branches and 1.12 tags.
https://framework.zend.com/blog/2016-06-28-zf1-eol.html
BSD 3-Clause "New" or "Revised" License
357 stars 798 forks source link

Zend_Date sub() behaviour on bisect years. #681

Open valugi opened 8 years ago

valugi commented 8 years ago

I am no sure this is a bug or what is the correct behavior, but I was expecting 28th of February more than 1st of March.

$date = new Zend_Date('2016-02-29', 'yyyy-MM-dd');
$date->sub(1, Zend_Date::YEAR); // Mar 1, 2015 12:00:00 AM
froschdesign commented 8 years ago

This is a bug, but the Zend_Date is error-prone and a fat code monster. I see no chance to fix the problem.

valugi commented 8 years ago

@froschdesign I love the optimism :)