Update to drupal-org-drupal 8.0.0-rc2. For more information, see https://www.drupal.org/node/2598668
This commit is contained in:
parent
f32e58e4b1
commit
8e18df8c36
3062 changed files with 15044 additions and 172506 deletions
|
@ -8,7 +8,6 @@
|
|||
namespace Drupal\Core\Datetime;
|
||||
|
||||
use Drupal\Core\Config\Entity\ConfigEntityInterface;
|
||||
use Drupal\Core\Datetime\DrupalDateTime;
|
||||
|
||||
/**
|
||||
* Provides an interface defining a date format.
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
namespace Drupal\Core\Datetime;
|
||||
|
||||
use Drupal\Core\Config\ConfigFactoryInterface;
|
||||
use Drupal\Core\Datetime\DrupalDateTime;
|
||||
use Drupal\Core\Entity\EntityManagerInterface;
|
||||
use Drupal\Core\Language\Language;
|
||||
use Drupal\Core\Language\LanguageManagerInterface;
|
||||
|
|
|
@ -16,8 +16,6 @@
|
|||
*/
|
||||
namespace Drupal\Core\Datetime;
|
||||
|
||||
use Drupal\Core\Datetime\DrupalDateTime;
|
||||
|
||||
/**
|
||||
* Defines Gregorian Calendar date values.
|
||||
*/
|
||||
|
@ -449,7 +447,7 @@ class DateHelper {
|
|||
* The number of days in the month.
|
||||
*/
|
||||
public static function daysInMonth($date = NULL) {
|
||||
if (!$date instanceOf DrupalDateTime) {
|
||||
if (!$date instanceof DrupalDateTime) {
|
||||
$date = new DrupalDateTime($date);
|
||||
}
|
||||
if (!$date->hasErrors()) {
|
||||
|
@ -469,7 +467,7 @@ class DateHelper {
|
|||
* The number of days in the year.
|
||||
*/
|
||||
public static function daysInYear($date = NULL) {
|
||||
if (!$date instanceOf DrupalDateTime) {
|
||||
if (!$date instanceof DrupalDateTime) {
|
||||
$date = new DrupalDateTime($date);
|
||||
}
|
||||
if (!$date->hasErrors()) {
|
||||
|
@ -494,7 +492,7 @@ class DateHelper {
|
|||
* The number of the day in the week.
|
||||
*/
|
||||
public static function dayOfWeek($date = NULL) {
|
||||
if (!$date instanceOf DrupalDateTime) {
|
||||
if (!$date instanceof DrupalDateTime) {
|
||||
$date = new DrupalDateTime($date);
|
||||
}
|
||||
if (!$date->hasErrors()) {
|
||||
|
@ -517,7 +515,7 @@ class DateHelper {
|
|||
* The name of the day in the week for that date.
|
||||
*/
|
||||
public static function dayOfWeekName($date = NULL, $abbr = TRUE) {
|
||||
if (!$date instanceOf DrupalDateTime) {
|
||||
if (!$date instanceof DrupalDateTime) {
|
||||
$date = new DrupalDateTime($date);
|
||||
}
|
||||
$dow = self::dayOfWeek($date);
|
||||
|
|
|
@ -66,7 +66,7 @@ abstract class DateElementBase extends FormElement {
|
|||
$min_year = $temp;
|
||||
}
|
||||
// If there is a current value, stretch the range to include it.
|
||||
$value_year = $date instanceOf DrupalDateTime ? $date->format('Y') : '';
|
||||
$value_year = $date instanceof DrupalDateTime ? $date->format('Y') : '';
|
||||
if (!empty($value_year)) {
|
||||
$min_year = min($value_year, $min_year);
|
||||
$max_year = max($value_year, $max_year);
|
||||
|
|
|
@ -67,7 +67,7 @@ class Datelist extends DateElementBase {
|
|||
}
|
||||
$timezone = !empty($element['#date_timezone']) ? $element['#date_timezone'] : NULL;
|
||||
$date = DrupalDateTime::createFromArray($input, $timezone);
|
||||
if ($date instanceOf DrupalDateTime && !$date->hasErrors()) {
|
||||
if ($date instanceof DrupalDateTime && !$date->hasErrors()) {
|
||||
static::incrementRound($date, $increment);
|
||||
}
|
||||
}
|
||||
|
@ -76,7 +76,7 @@ class Datelist extends DateElementBase {
|
|||
$return = array_fill_keys($parts, '');
|
||||
if (!empty($element['#default_value'])) {
|
||||
$date = $element['#default_value'];
|
||||
if ($date instanceOf DrupalDateTime && !$date->hasErrors()) {
|
||||
if ($date instanceof DrupalDateTime && !$date->hasErrors()) {
|
||||
static::incrementRound($date, $increment);
|
||||
foreach ($parts as $part) {
|
||||
switch ($part) {
|
||||
|
@ -184,7 +184,7 @@ class Datelist extends DateElementBase {
|
|||
$date = !empty($element['#value']['object']) ? $element['#value']['object'] : NULL;
|
||||
|
||||
// Set a fallback timezone.
|
||||
if ($date instanceOf DrupalDateTime) {
|
||||
if ($date instanceof DrupalDateTime) {
|
||||
$element['#date_timezone'] = $date->getTimezone()->getName();
|
||||
}
|
||||
elseif (!empty($element['#timezone'])) {
|
||||
|
@ -253,7 +253,7 @@ class Datelist extends DateElementBase {
|
|||
}
|
||||
|
||||
$default = isset($element['#value'][$part]) && trim($element['#value'][$part]) != '' ? $element['#value'][$part] : '';
|
||||
$value = $date instanceOf DrupalDateTime && !$date->hasErrors() ? $date->format($format) : $default;
|
||||
$value = $date instanceof DrupalDateTime && !$date->hasErrors() ? $date->format($format) : $default;
|
||||
if (!empty($value) && $part != 'ampm') {
|
||||
$value = intval($value);
|
||||
}
|
||||
|
@ -320,7 +320,7 @@ class Datelist extends DateElementBase {
|
|||
else {
|
||||
// If the input is valid, set it.
|
||||
$date = $input['object'];
|
||||
if ($date instanceOf DrupalDateTime && !$date->hasErrors()) {
|
||||
if ($date instanceof DrupalDateTime && !$date->hasErrors()) {
|
||||
$form_state->setValueForElement($element, $date);
|
||||
}
|
||||
// If the input is invalid, set an error.
|
||||
|
@ -364,7 +364,7 @@ class Datelist extends DateElementBase {
|
|||
*/
|
||||
protected static function incrementRound(&$date, $increment) {
|
||||
// Round minutes and seconds, if necessary.
|
||||
if ($date instanceOf DrupalDateTime && $increment > 1) {
|
||||
if ($date instanceof DrupalDateTime && $increment > 1) {
|
||||
$day = intval($date->format('j'));
|
||||
$hour = intval($date->format('H'));
|
||||
$second = intval(round(intval($date->format('s')) / $increment) * $increment);
|
||||
|
|
|
@ -101,7 +101,7 @@ class Datetime extends DateElementBase {
|
|||
}
|
||||
else {
|
||||
$date = $element['#default_value'];
|
||||
if ($date instanceOf DrupalDateTime && !$date->hasErrors()) {
|
||||
if ($date instanceof DrupalDateTime && !$date->hasErrors()) {
|
||||
$input = array(
|
||||
'date' => $date->format($element['#date_date_format']),
|
||||
'time' => $date->format($element['#date_time_format']),
|
||||
|
@ -223,7 +223,7 @@ class Datetime extends DateElementBase {
|
|||
$date = !empty($element['#value']['object']) ? $element['#value']['object'] : NULL;
|
||||
|
||||
// Set a fallback timezone.
|
||||
if ($date instanceOf DrupalDateTime) {
|
||||
if ($date instanceof DrupalDateTime) {
|
||||
$element['#date_timezone'] = $date->getTimezone()->getName();
|
||||
}
|
||||
elseif (empty($element['#timezone'])) {
|
||||
|
@ -246,7 +246,7 @@ class Datetime extends DateElementBase {
|
|||
);
|
||||
|
||||
// Adds the HTML5 date attributes.
|
||||
if ($date instanceOf DrupalDateTime && !$date->hasErrors()) {
|
||||
if ($date instanceof DrupalDateTime && !$date->hasErrors()) {
|
||||
$html5_min = clone($date);
|
||||
$range = static::datetimeRangeYears($element['#date_year_range'], $date);
|
||||
$html5_min->setDate($range[0], 1, 1)->setTime(0, 0, 0);
|
||||
|
|
Reference in a new issue