Permalink
Browse files

CLocale::getWeekDayName() more compatible with date()

allowing 0 and 7 for sunday.
manually merged #1663
  • Loading branch information...
cebe committed Nov 14, 2012
1 parent 8704436 commit b7c2f5a7732721498f7f7a37eb371a367befdcc5
Showing with 3 additions and 1 deletion.
  1. +1 −0 CHANGELOG
  2. +2 −1 framework/i18n/CLocale.php
View
@@ -80,6 +80,7 @@ Version 1.1.13 work in progress
- Enh: Value of the CHtml::activeTextArea() can now be set through $htmlOptions['value'] (resurtm)
- Enh: Allow to customize CHtml::error() container tag (creocoder)
- Enh: CModule::setComponents() now can reconfigure already loaded components (creocoder)
+- Enh: CLocale::getWeekDayName() weekday-number argument is now more compatible with date() function, allowing 0 and 7 for sunday (Yiivgeny, cebe)
- Chg #1373: Upgraded jquery star rating to 3.14 (samdark)
- Chg #1563: Updated CTestCase for PHPUnit 3.7.7+ (tanakahisateru, samdark)
- Chg: MSSQL unit tests updated and actualized, added SQLSRV driver support (resurtm)
@@ -222,13 +222,14 @@ public function getMonthNames($width='wide',$standAlone=false)
}
/**
- * @param integer $day weekday (0-6, 0 means Sunday)
+ * @param integer $day weekday (0-7, 0 and 7 means Sunday)
* @param string $width weekday name width. It can be 'wide', 'abbreviated' or 'narrow'.
* @param boolean $standAlone whether the week day name should be returned in stand-alone format
* @return string the weekday name
*/
public function getWeekDayName($day,$width='wide',$standAlone=false)
{
+ $day=$day%7;
if($standAlone)
return isset($this->_data['weekDayNamesSA'][$width][$day]) ? $this->_data['weekDayNamesSA'][$width][$day] : $this->_data['weekDayNames'][$width][$day];
else

0 comments on commit b7c2f5a

Please sign in to comment.