Mercurial > hg > isophonics-drupal-site
diff core/modules/datetime/datetime.module @ 14:1fec387a4317
Update Drupal core to 8.5.2 via Composer
author | Chris Cannam |
---|---|
date | Mon, 23 Apr 2018 09:46:53 +0100 |
parents | 4c8ae668cc8c |
children | af1871eacc83 |
line wrap: on
line diff
--- a/core/modules/datetime/datetime.module Mon Apr 23 09:33:26 2018 +0100 +++ b/core/modules/datetime/datetime.module Mon Apr 23 09:46:53 2018 +0100 @@ -9,16 +9,34 @@ /** * Defines the timezone that dates should be stored in. + * + * @deprecated in Drupal 8.5.x and will be removed before Drupal 9.0.x. Use + * \Drupal\datetime\Plugin\Field\FieldType\DateTimeItemInterface::STORAGE_TIMEZONE + * instead. + * + * @see https://www.drupal.org/node/2912980 */ const DATETIME_STORAGE_TIMEZONE = 'UTC'; /** * Defines the format that date and time should be stored in. + * + * @deprecated in Drupal 8.5.x and will be removed before Drupal 9.0.x. Use + * \Drupal\datetime\Plugin\Field\FieldType\DateTimeItemInterface::DATETIME_STORAGE_FORMAT + * instead. + * + * @see https://www.drupal.org/node/2912980 */ const DATETIME_DATETIME_STORAGE_FORMAT = 'Y-m-d\TH:i:s'; /** * Defines the format that dates should be stored in. + * + * @deprecated in Drupal 8.5.x and will be removed before Drupal 9.0.x. Use + * \Drupal\datetime\Plugin\Field\FieldType\DateTimeItemInterface::DATE_STORAGE_FORMAT + * instead. + * + * @see https://www.drupal.org/node/2912980 */ const DATETIME_DATE_STORAGE_FORMAT = 'Y-m-d'; @@ -50,7 +68,20 @@ * same value for in both the local timezone and UTC. * * @param $date + * + * @deprecated in Drupal 8.5.0 and will be removed before Drupal 9.0.0. Use + * \Drupal\Component\Datetime\DateTimePlus::setDefaultDateTime() or + * \Drupal\Core\Datetime\DrupalDateTime::setDefaultDateTime() instead. + * + * @see https://www.drupal.org/node/2880931 */ function datetime_date_default_time($date) { + @trigger_error('datetime_date_default_time() is deprecated in Drupal 8.5.0 and will be removed before Drupal 9.0.0. Use \Drupal\Component\Datetime\DateTimePlus::setDefaultDateTime() or \Drupal\Core\Datetime\DrupalDateTime::setDefaultDateTime() instead. See https://www.drupal.org/node/2880931.', E_USER_DEPRECATED); + + // For maximum BC before this method is removed, we do not use the + // recommendation from the deprecation method. Instead, we call the setTime() + // method directly. This allows the method to continue to work with + // \DateTime, DateTimePlus, and DrupalDateTime objects (and classes that + // may derive from them). $date->setTime(12, 0, 0); }