euromark 11 年之前
父节点
当前提交
bcfa2822fe
共有 2 个文件被更改,包括 5 次插入0 次删除
  1. 1 0
      Test/Case/Lib/Utility/TimeLibTest.php
  2. 4 0
      View/Helper/DatetimeHelper.php

+ 1 - 0
Test/Case/Lib/Utility/TimeLibTest.php

@@ -357,6 +357,7 @@ class TimeLibTest extends MyCakeTestCase {
 
 
 		$this->assertEquals('2', TimeLib::age('2005-03-01', '2008-02-28'));
 		$this->assertEquals('2', TimeLib::age('2005-03-01', '2008-02-28'));
 		if (WINDOWS) {
 		if (WINDOWS) {
+			// On some local devs this seems to return the wrong age 3...
 			$this->assertEquals('3', TimeLib::age('2005-03-01', '2008-02-29'));
 			$this->assertEquals('3', TimeLib::age('2005-03-01', '2008-02-29'));
 		} else {
 		} else {
 			$this->assertEquals('2', TimeLib::age('2005-03-01', '2008-02-29'));
 			$this->assertEquals('2', TimeLib::age('2005-03-01', '2008-02-29'));

+ 4 - 0
View/Helper/DatetimeHelper.php

@@ -34,6 +34,8 @@ class DatetimeHelper extends TimeHelper {
 
 
 	/**
 	/**
 	 * Like localDate(), only with additional markup <span> and class="today", if today, etc
 	 * Like localDate(), only with additional markup <span> and class="today", if today, etc
+	 *
+	 * @return string
 	 */
 	 */
 	public function localDateMarkup($dateString = null, $format = null, $options = array()) {
 	public function localDateMarkup($dateString = null, $format = null, $options = array()) {
 		$date = $this->localDate($dateString, $format, $options);
 		$date = $this->localDate($dateString, $format, $options);
@@ -43,6 +45,8 @@ class DatetimeHelper extends TimeHelper {
 
 
 	/**
 	/**
 	 * Like niceDate(), only with additional markup <span> and class="today", if today, etc
 	 * Like niceDate(), only with additional markup <span> and class="today", if today, etc
+	 *
+	 * @return string
 	 */
 	 */
 	public function niceDateMarkup($dateString = null, $format = null, $options = array()) {
 	public function niceDateMarkup($dateString = null, $format = null, $options = array()) {
 		$date = $this->niceDate($dateString, $format, $options);
 		$date = $this->niceDate($dateString, $format, $options);