framework/i18n/CDateFormatter.php
protected function formatWeekInMonth($pattern,$date)
	{
		if($pattern==='W')
		{
			$weekDay=date('N',mktime(0,0,0,$date['mon'],1,$date['year']));
			return floor(($weekDay+$date['mday']-2)/7)+1;
		}
		else
			throw new CException(Yii::t('yii','The pattern for week in month must be "W".'));
	}
protected function formatWeekInMonth($pattern,$date)
	{
		if($pattern==='W')
		{
			$weekDay=date('N',mktime(0,0,0,$date['mon'],1,$date['year']));
			return floor(($weekDay+$date['mday']-2)/7)+1;
		}
		else
			throw new CException(Yii::t('yii','The pattern for week in month must be "W".'));
	}
protected function formatWeekInMonth ( $ pattern , $ date ) { if ( $ pattern === 'W' ) { $ weekDay = date ( 'N' , mktime ( 0 , 0 , 0 , $ date [ 'mon' ] , 1 , $ date [ 'year' ] ) ) ; return floor ( ( $ weekDay + $ date [ 'mday' ] - 2 ) / 7 ) + 1 ; } else throw new CException ( Yii :: t ( 'yii' , 'The pattern for week in month must be "W".' ) ) ; }
Get week in the month.
@param array $pattern result of {@link CTimestamp::getdate}.
@param string $date a pattern.
@throws CException if "weekInMonth" pattern is unknown
@return integer week in month
Get week in the month .