function niceShort($dateString = null, $timezone = null) { if (!$dateString) { return '-'; } $ret = parent::niceShort($dateString, $timezone); $aReplaceENG = array('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jul', 'Jun', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'); $aReplace = array(__('Jan'), __('Feb'), __('Mar'), __('Apr'), __('May'), __('Jul'), __('Jun'), __('Aug'), __('Sep'), __('Oct'), __('Nov'), __('Dec')); return $ret; return str_replace(array('st', 'nd', 'th'), '', str_replace($aReplaceENG, $aReplace, $ret)); }
/** * Returns a formatted descriptive date string for given datetime string. * * If the given date is today, the returned string could be "Today, 16:54". * If the given date was yesterday, the returned string could be "Yesterday, 16:54". * If $dateString's year is the current year, the returned string does not * include mention of the year. * * @param string $dateString Datetime string or Unix timestamp * @param int $userOffset User's offset from GMT (in hours) * @return string Described, relative date string * @access public * @link http://book.cakephp.org/view/1471/Formatting */ function niceShort($dateString = null, $userOffset = null) { return parent::niceShort($dateString, $this->__userOffset($dateString, $userOffset)); }