diff --git a/core/modules/datetime/datetime.module b/core/modules/datetime/datetime.module index 4760b38..245d0c4 100644 --- a/core/modules/datetime/datetime.module +++ b/core/modules/datetime/datetime.module @@ -13,6 +13,8 @@ * @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'; @@ -22,6 +24,8 @@ * @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'; @@ -31,6 +35,8 @@ * @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'; diff --git a/core/modules/datetime/src/Plugin/Field/FieldType/DateTimeItem.php b/core/modules/datetime/src/Plugin/Field/FieldType/DateTimeItem.php index 45d8846..3264069 100644 --- a/core/modules/datetime/src/Plugin/Field/FieldType/DateTimeItem.php +++ b/core/modules/datetime/src/Plugin/Field/FieldType/DateTimeItem.php @@ -109,10 +109,10 @@ public static function generateSampleValue(FieldDefinitionInterface $field_defin // type. $timestamp = REQUEST_TIME - mt_rand(0, 86400 * 365); if ($type == DateTimeItem::DATETIME_TYPE_DATE) { - $values['value'] = gmdate(DateTimeItemInterface::DATE_STORAGE_FORMAT, $timestamp); + $values['value'] = gmdate(static::DATE_STORAGE_FORMAT, $timestamp); } else { - $values['value'] = gmdate(DateTimeItemInterface::DATETIME_STORAGE_FORMAT, $timestamp); + $values['value'] = gmdate(static::DATETIME_STORAGE_FORMAT, $timestamp); } return $values; }