public static function getCalendarPrettyDate($period) { if ($period instanceof Month) { // show month name when period is for a month return $period->getLocalizedLongString(); } else { return $period->getPrettyString(); } }