Open tomasfejfar opened 9 years ago
Is that feature or bug?
It's not supported. :wink:
In my opinion, Zend_Date
is deprecated.
The extraction of the date parts is ugly. (For more information please see #207.)
Can it be properly marked as deprecated? It is not ATM AFAIK https://github.com/zendframework/zf1/blob/master/library/Zend/Date.php - there is no "deprecated" string in the whole class.
Or better it should not work with unsupported params. Validation passing is the worst way to deal with it, because it's really hard to find what is the actual problem.
there is no "deprecated" string in the whole class.
I wrote: "In my opinion…"
it's really hard to find what is the actual problem
This is true for all Zend_Date
and Zend_Locale
classes.
So the resolution is practically "Known issue" -> "Won't fix"
? Or can I do something to make this more developer friendly?
So the resolution is practically "Known issue" -> "Won't fix"?
The issue is still open!
Or can I do something to make this more developer friendly?
Any suggestion or idea is welcome.
What about having it properly deprecated? There is no point in trying to fix it for currently outdated PHP version (5.2). Everywhere else you can use \DateTime. I would even go so far as to rewrite the internals to use DateTime where possible. A project I'm working on is bound to stay on ZF1 for some time so it still makes sense to future-proof ZF1. I am not sure whether new ZF releases have to support <5.3 PHP versions now that 5.2 is outdated and discouraged.
I would even go so far as to rewrite the internals to use DateTime where possible.
The idea is not new, but this would result in different behaviours, date outputs and validation results.
My advice to you: Don't do that, it's too many work and a very very hard way. (I have tried it.)
We need a solution/migration path from Zend_Date
to DateTime
or ZF2.
@akrabat Any comments or ideas?
Another problem: we can not upgrade to a newer CLDR version.
Expected:
false, false
Actual:true, false
Problem seem to lie in
\Zend_Date::isDate('2015-05-01|DEFAULT', 'Y-m-d', null); // true
being called inside the validator. And the call https://github.com/zendframework/zf1/blob/master/library/Zend/Locale/Format.php#L908 called inside there. That ignores everything except numbers (meaning it strips the|DEFAULT
).Is that feature or bug? In my opinion it's a bug.