protected function getDayInMonth($date, $pattern = 'FF')
{
switch ($pattern) {
case 'F':
return @date('j', @mktime(0, 0, 0, $date['mon'], $date['mday'], $date['year']));
break;
case 'FF':
return @date('d', @mktime(0, 0, 0, $date['mon'], $date['mday'], $date['year']));
break;
default:
throw new Exception('The pattern for day in month is "F" or "FF".');
}
}