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".'));
	}