"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "framework/i18n/CDateFormatter.php" between
yii-1.1.21.733ac5.tar.gz and yii-1.1.22.bf1d26.tar.gz

About: Yii is a high-performance component-based PHP framework for developing large-scale Web applications. Hint: Yii 1.1 is now in maintenance mode.

CDateFormatter.php  (yii-1.1.21.733ac5):CDateFormatter.php  (yii-1.1.22.bf1d26)
skipping to change at line 93 skipping to change at line 93
* @param mixed $time UNIX timestamp or a string in strtotime format * @param mixed $time UNIX timestamp or a string in strtotime format
* @return string formatted date time. Null if $time is null. (the null v alue check is available since Yii 1.1.11) * @return string formatted date time. Null if $time is null. (the null v alue check is available since Yii 1.1.11)
*/ */
public function format($pattern,$time) public function format($pattern,$time)
{ {
if($time===null) if($time===null)
return null; return null;
if(is_string($time)) if(is_string($time))
{ {
if(ctype_digit($time) || ($time{0}=='-' && ctype_digit(su bstr($time, 1)))) if(ctype_digit($time) || ($time[0]=='-' && ctype_digit(su bstr($time, 1))))
$time=(int)$time; $time=(int)$time;
else else
$time=strtotime($time); $time=strtotime($time);
} }
$date=CTimestamp::getDate($time,false,false); $date=CTimestamp::getDate($time,false,false);
$tokens=$this->parseFormat($pattern); $tokens=$this->parseFormat($pattern);
foreach($tokens as &$token) foreach($tokens as &$token)
{ {
if(is_array($token)) // a callback: method name, sub-patt ern if(is_array($token)) // a callback: method name, sub-patt ern
$token=$this->{$token[0]}($token[1],$date); $token=$this->{$token[0]}($token[1],$date);
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)