Mercurial > hg > isophonics-drupal-site
comparison 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 |
comparison
equal
deleted
inserted
replaced
13:5fb285c0d0e3 | 14:1fec387a4317 |
---|---|
7 | 7 |
8 use Drupal\Core\Routing\RouteMatchInterface; | 8 use Drupal\Core\Routing\RouteMatchInterface; |
9 | 9 |
10 /** | 10 /** |
11 * Defines the timezone that dates should be stored in. | 11 * Defines the timezone that dates should be stored in. |
12 * | |
13 * @deprecated in Drupal 8.5.x and will be removed before Drupal 9.0.x. Use | |
14 * \Drupal\datetime\Plugin\Field\FieldType\DateTimeItemInterface::STORAGE_TIMEZONE | |
15 * instead. | |
16 * | |
17 * @see https://www.drupal.org/node/2912980 | |
12 */ | 18 */ |
13 const DATETIME_STORAGE_TIMEZONE = 'UTC'; | 19 const DATETIME_STORAGE_TIMEZONE = 'UTC'; |
14 | 20 |
15 /** | 21 /** |
16 * Defines the format that date and time should be stored in. | 22 * Defines the format that date and time should be stored in. |
23 * | |
24 * @deprecated in Drupal 8.5.x and will be removed before Drupal 9.0.x. Use | |
25 * \Drupal\datetime\Plugin\Field\FieldType\DateTimeItemInterface::DATETIME_STORAGE_FORMAT | |
26 * instead. | |
27 * | |
28 * @see https://www.drupal.org/node/2912980 | |
17 */ | 29 */ |
18 const DATETIME_DATETIME_STORAGE_FORMAT = 'Y-m-d\TH:i:s'; | 30 const DATETIME_DATETIME_STORAGE_FORMAT = 'Y-m-d\TH:i:s'; |
19 | 31 |
20 /** | 32 /** |
21 * Defines the format that dates should be stored in. | 33 * Defines the format that dates should be stored in. |
34 * | |
35 * @deprecated in Drupal 8.5.x and will be removed before Drupal 9.0.x. Use | |
36 * \Drupal\datetime\Plugin\Field\FieldType\DateTimeItemInterface::DATE_STORAGE_FORMAT | |
37 * instead. | |
38 * | |
39 * @see https://www.drupal.org/node/2912980 | |
22 */ | 40 */ |
23 const DATETIME_DATE_STORAGE_FORMAT = 'Y-m-d'; | 41 const DATETIME_DATE_STORAGE_FORMAT = 'Y-m-d'; |
24 | 42 |
25 /** | 43 /** |
26 * Implements hook_help(). | 44 * Implements hook_help(). |
48 * The default time for a date without time can be anything, so long as it is | 66 * The default time for a date without time can be anything, so long as it is |
49 * consistently applied. If we use noon, dates in most timezones will have the | 67 * consistently applied. If we use noon, dates in most timezones will have the |
50 * same value for in both the local timezone and UTC. | 68 * same value for in both the local timezone and UTC. |
51 * | 69 * |
52 * @param $date | 70 * @param $date |
71 * | |
72 * @deprecated in Drupal 8.5.0 and will be removed before Drupal 9.0.0. Use | |
73 * \Drupal\Component\Datetime\DateTimePlus::setDefaultDateTime() or | |
74 * \Drupal\Core\Datetime\DrupalDateTime::setDefaultDateTime() instead. | |
75 * | |
76 * @see https://www.drupal.org/node/2880931 | |
53 */ | 77 */ |
54 function datetime_date_default_time($date) { | 78 function datetime_date_default_time($date) { |
79 @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); | |
80 | |
81 // For maximum BC before this method is removed, we do not use the | |
82 // recommendation from the deprecation method. Instead, we call the setTime() | |
83 // method directly. This allows the method to continue to work with | |
84 // \DateTime, DateTimePlus, and DrupalDateTime objects (and classes that | |
85 // may derive from them). | |
55 $date->setTime(12, 0, 0); | 86 $date->setTime(12, 0, 0); |
56 } | 87 } |