浏览代码

Update DateTime.php

Mark Scherer 1 年之前
父节点
当前提交
5b23fef9dc
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      src/I18n/DateTime.php

+ 3 - 0
src/I18n/DateTime.php

@@ -141,6 +141,9 @@ class DateTime extends CakeDateTime {
 			return -1;
 		}
 
+		if ($startDate instanceof CakeDate) {
+			$startDate = $startDate->toNative();
+		}
 		$oDateInterval = $endDate->diff($startDate);
 
 		return $oDateInterval->y;