Change record status: 
Project: 
Introduced in branch: 
8.1.X
Description: 

Description:

\Drupal\Component\Datetime\DateTimePlus() has a __call magic method on it to pass method calls to the \DateTime object that it wraps. Because DateTimePlus() wraps a \DateTime object instead of extending the class, the implicit \Drupal\Component\Datetime\DateTimePlus::diff(), and by extension \Drupal\Core\Datetime\DrupalDateTime::diff(), methods did not work properly. To fix this, an explicit DateTimePlus::diff() method was introduced to produce the expected behavior.

As part of error checking, both DrupalDateTime::diff() and DateTimePlus::diff() can now throw a \BadMethodCallException when the parameter isn't a DateTimePlus or \DateTime object, or an object from a class that extends either. Since, DrupalDateTime extends DateTimePlus, it can be used as a parameter.

Impacts: 
Module developers
Updates Done (doc team, etc.)
Online documentation: 
Not done
Theming guide: 
Not done
Module developer documentation: 
Not done
Examples project: 
Not done
Coder Review: 
Not done
Coder Upgrade: 
Not done
Other: 
Other updates done