ZF-5259: CLONE -setweekday() parameters rule does not same as display rule
Description
Zend_Date to array or display the Weekday, always consider the Sunday is '0', but setweekday() consider Sunday is '7'.
would that can be the same rule ?
Zend_Date to array or display the Weekday, always consider the Sunday is '0', but setweekday() consider Sunday is '7'.
would that can be the same rule ?
Comments
Posted by Liber Chen (liber) on 2008-12-14T23:48:54.000+0000
I mean the setWeekDay follows the ISO standard, so sunday is '7'. But if use toArray() of Zend_Date, the weekday will be '0' as the GNU standard.
I suggest that use one rule for Zend_Date, not two different kind of rule. It will make people confused.
Posted by Thomas Weidner (thomas) on 2008-12-15T00:41:09.000+0000
Why would this be a problem when both rules are supported ?
Posted by Liber Chen (liber) on 2008-12-15T00:58:20.000+0000
It is not consistent.
Please consider below situation:
$a->setWeekDay(7);
$b = $a->toArray(); $weekDay = $b['weekday'];
echo $weekDay (It is 0, not 7)
But if it is consistent. Then we can define a constant to check it.
define('SUNDAY', 0); ( Or 7 if ISO standard)
$a->setWeekDay(SUNDAY); $b = $a->toArray(); $weekDay = $b['weekday'];
echo $weekDay==SUNDAY (This will be true, because it is consistent)
Posted by Thomas Weidner (thomas) on 2008-12-15T03:56:36.000+0000
Integrated with r13258