This commit is contained in:
Yuri Kuznetsov
2021-09-10 21:13:22 +03:00
parent 48957d33b6
commit 0873b17894
3 changed files with 9 additions and 0 deletions
+3
View File
@@ -167,6 +167,9 @@ class Date implements DateTimeable
return self::fromDateTime($dateTime);
}
/**
* A difference between another object (date or date-time) and self.
*/
public function diff(DateTimeable $other): DateInterval
{
return $this->getDateTime()->diff($other->getDateTime());
+3
View File
@@ -199,6 +199,9 @@ class DateTime implements DateTimeable
return self::fromDateTime($dateTime);
}
/**
* A difference between another object (date or date-time) and self.
*/
public function diff(DateTimeable $other): DateInterval
{
return $this->getDateTime()->diff($other->getDateTime());
@@ -262,6 +262,9 @@ class DateTimeOptional implements DateTimeable
);
}
/**
* A difference between another object (date or date-time) and self.
*/
public function diff(DateTimeable $other): DateInterval
{
return $this->getDateTime()->diff($other->getDateTime());