Update to Drupal 8.1.1. For more information, see https://www.drupal.org/node/2718713
This commit is contained in:
parent
c0a0d5a94c
commit
9eae24d844
669 changed files with 3873 additions and 1553 deletions
|
|
@ -41,13 +41,15 @@ class DateTimeDefaultFormatter extends DateTimeFormatterBase {
|
|||
if ($item->date) {
|
||||
/** @var \Drupal\Core\Datetime\DrupalDateTime $date */
|
||||
$date = $item->date;
|
||||
// Create the ISO date in Universal Time.
|
||||
$iso_date = $date->format("Y-m-d\TH:i:s") . 'Z';
|
||||
|
||||
if ($this->getFieldSetting('datetime_type') == 'date') {
|
||||
// A date without time will pick up the current time, use the default.
|
||||
datetime_date_default_time($date);
|
||||
}
|
||||
|
||||
// Create the ISO date in Universal Time.
|
||||
$iso_date = $date->format("Y-m-d\TH:i:s") . 'Z';
|
||||
|
||||
$this->setTimeZone($date);
|
||||
|
||||
$output = $this->formatDate($date);
|
||||
|
|
|
|||
|
|
@ -95,12 +95,12 @@ class DateTimeFieldItemList extends FieldItemList {
|
|||
// A default value should be in the format and timezone used for date
|
||||
// storage.
|
||||
$date = new DrupalDateTime($default_value[0]['default_date'], DATETIME_STORAGE_TIMEZONE);
|
||||
$storage_format = $definition->getSetting('datetime_type') == DateTimeItem::DATETIME_TYPE_DATE ? DATETIME_DATE_STORAGE_FORMAT: DATETIME_DATETIME_STORAGE_FORMAT;
|
||||
$storage_format = $definition->getSetting('datetime_type') == DateTimeItem::DATETIME_TYPE_DATE ? DATETIME_DATE_STORAGE_FORMAT : DATETIME_DATETIME_STORAGE_FORMAT;
|
||||
$value = $date->format($storage_format);
|
||||
// We only provide a default value for the first item, as do all fields.
|
||||
// Otherwise, there is no way to clear out unwanted values on multiple value
|
||||
// fields.
|
||||
$default_value = array(
|
||||
$default_value = array(
|
||||
array(
|
||||
'value' => $value,
|
||||
'date' => $date,
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ class DateTimeItem extends FieldItemBase {
|
|||
|
||||
// Just pick a date in the past year. No guidance is provided by this Field
|
||||
// type.
|
||||
$timestamp = REQUEST_TIME - mt_rand(0, 86400*365);
|
||||
$timestamp = REQUEST_TIME - mt_rand(0, 86400 * 365);
|
||||
if ($type == DateTimeItem::DATETIME_TYPE_DATE) {
|
||||
$values['value'] = gmdate(DATETIME_DATE_STORAGE_FORMAT, $timestamp);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ class DateTimeDatelistWidget extends DateTimeWidgetBase {
|
|||
$element['value'] = array(
|
||||
'#type' => 'datelist',
|
||||
'#date_increment' => $increment,
|
||||
'#date_part_order'=> $date_part_order,
|
||||
'#date_part_order' => $date_part_order,
|
||||
) + $element['value'];
|
||||
|
||||
return $element;
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ class DateTimeDefaultWidget extends DateTimeWidgetBase implements ContainerFacto
|
|||
}
|
||||
|
||||
$element['value'] += array(
|
||||
'#date_date_format'=> $date_format,
|
||||
'#date_date_format' => $date_format,
|
||||
'#date_date_element' => $date_type,
|
||||
'#date_date_callbacks' => array(),
|
||||
'#date_time_format' => $time_format,
|
||||
|
|
|
|||
Reference in a new issue