Ejemplo n.º 1
0
 public function afterFind($results, $primary = false)
 {
     App::uses('CakeTime', 'Utility');
     foreach ($results as &$result) {
         if (isset($result[$this->alias]['modified'])) {
             $result[$this->alias]['niceday'] = CakeTime::niceShort($result[$this->alias]['modified']);
         }
     }
     return $results;
 }
Ejemplo n.º 2
0
 /**
  * Returns a formatted descriptive date string for given datetime string.
  *
  * @param int|string|DateTime $dateString UNIX timestamp, strtotime() valid string or DateTime object.
  * @param string|DateTimeZone $timezone   User's timezone string or DateTimeZone object
  *
  * @return string Described, relative date string
  * @see  CakeTime::niceShort()
  * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#formatting
  */
 public function niceShort($dateString = NULL, $timezone = NULL)
 {
     return $this->_engine->niceShort($dateString, $timezone);
 }