public static function formatByUnit(Gpf_DateTime $date, $unitType) { switch ($unitType) { case Gpf_Common_DateUtils::DAY: return $date->toLocaleDate(); case Gpf_Common_DateUtils::MONTH: return $date->format('M Y'); case Gpf_Common_DateUtils::YEAR: return $date->getYear(); case Gpf_Common_DateUtils::WEEK: return $date->getWeekStart()->toLocaleDate() . " - " . $date->getWeekEnd()->toLocaleDate(); default: return $date->toLocaleDate(); } }