Issue #2116327 by martin107: Creating DrupalDateTime object, with a 'date' array as input will always fail with exception

8.0.x
Alex Pott 2014-12-15 17:07:58 +00:00
parent 1c61006d90
commit 000f3924f3
1 changed files with 7 additions and 3 deletions

View File

@ -14,6 +14,11 @@ use Drupal\Component\Datetime\DateTimePlus;
* This class extends the basic component and adds in Drupal-specific
* handling, like translation of the format() method.
*
* Static methods in base class can also be used to create DrupalDateTime objects.
* For example:
*
* DrupalDateTime::createFromArray( array('year' => 2010, 'month' => 9, 'day' => 28) )
*
* @see \Drupal/Component/Datetime/DateTimePlus.php
*/
class DrupalDateTime extends DateTimePlus {
@ -21,9 +26,8 @@ class DrupalDateTime extends DateTimePlus {
/**
* Constructs a date object.
*
* @param mixed $time
* A DateTime object, a date/input_time_adjusted string, a unix timestamp,
* or an array of date parts, like ('year' => 2014, 'month => 4).
* @param string $time
* A DateTime object, a date/input_time_adjusted string, a unix timestamp.
* Defaults to 'now'.
* @param mixed $timezone
* PHP DateTimeZone object, string or NULL allowed.