Browse Source

Update DateTime.php

Mark Scherer 1 year ago
parent
commit
5b23fef9dc
1 changed files with 3 additions and 0 deletions
  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;