diff --git a/core/lib/Drupal/Core/Datetime/Date.php b/core/lib/Drupal/Core/Datetime/Date.php index 78709e1..1ff241e 100644 --- a/core/lib/Drupal/Core/Datetime/Date.php +++ b/core/lib/Drupal/Core/Datetime/Date.php @@ -30,7 +30,7 @@ class Date { * * @var \Drupal\Core\Entity\EntityStorageControllerInterface */ - protected $dateStorage; + protected $dateFormatStorage; /** * Language manager for retrieving the default langcode when none is specified. @@ -48,7 +48,7 @@ class Date { * The language manager. */ public function __construct(EntityManager $entity_manager, LanguageManager $language_manager) { - $this->dateStorage = $entity_manager->getStorageController('date_format'); + $this->dateFormatStorage = $entity_manager->getStorageController('date_format'); $this->languageManager = $language_manager; } @@ -103,13 +103,13 @@ public function format($timestamp, $type = 'medium', $format = '', $timezone = N $key = $date->canUseIntl() ? DrupalDateTime::INTL : DrupalDateTime::PHP; // If we have a non-custom date format use the provided date format pattern. - if ($date_format = $this->dateStorage->load($type)) { + if ($date_format = $this->dateFormatStorage->load($type)) { $format = $date_format->getPattern($key); } // Fall back to medium if a format was not found. if (empty($format)) { - $format = $this->dateStorage->load('medium')->getPattern($key); + $format = $this->dateFormatStorage->load('medium')->getPattern($key); } // Call $date->format(). diff --git a/core/modules/system/config/system.date_format.html_date.yml b/core/modules/system/config/system.date_format.html_date.yml index 9098f3e..6d4e004 100644 --- a/core/modules/system/config/system.date_format.html_date.yml +++ b/core/modules/system/config/system.date_format.html_date.yml @@ -1,8 +1,10 @@ id: html_date +uuid: f4028e7f-3ed8-4737-8f27-39b618214a1f label: 'HTML Date' -pattern: - php: 'Y-m-d' - intl: 'yyyy-MM-dd' status: '1' langcode: en locked: '1' +locales: { } +pattern: + php: Y-m-d + intl: yyyy-MM-dd diff --git a/core/modules/system/config/system.date_format.html_datetime.yml b/core/modules/system/config/system.date_format.html_datetime.yml index fd9e9a0..624f935 100644 --- a/core/modules/system/config/system.date_format.html_datetime.yml +++ b/core/modules/system/config/system.date_format.html_datetime.yml @@ -1,8 +1,10 @@ id: html_datetime +uuid: bfd7db46-607f-477f-9047-713c312dbb02 label: 'HTML Datetime' -pattern: - php: 'Y-m-d\TH:i:sO' - intl: 'yyyy-MM-dd''T''kk:mm:ssZZ' status: '1' langcode: en locked: '1' +locales: { } +pattern: + php: 'Y-m-d\TH:i:sO' + intl: 'yyyy-MM-dd''T''kk:mm:ssZZ' diff --git a/core/modules/system/config/system.date_format.html_month.yml b/core/modules/system/config/system.date_format.html_month.yml index cd5a358..92fe715 100644 --- a/core/modules/system/config/system.date_format.html_month.yml +++ b/core/modules/system/config/system.date_format.html_month.yml @@ -1,8 +1,10 @@ id: html_month +uuid: f85dd1b6-0edb-4024-a800-bb8c87805b2b label: 'HTML Month' -pattern: - php: 'Y-m' - intl: 'Y-MM' status: '1' langcode: en locked: '1' +locales: { } +pattern: + php: Y-m + intl: Y-MM diff --git a/core/modules/system/config/system.date_format.html_time.yml b/core/modules/system/config/system.date_format.html_time.yml index 79139f9..a2aaf35 100644 --- a/core/modules/system/config/system.date_format.html_time.yml +++ b/core/modules/system/config/system.date_format.html_time.yml @@ -1,8 +1,10 @@ id: html_time +uuid: f8e87532-396e-4353-b02c-4493d2031bc6 label: 'HTML Time' -pattern: - php: 'H:i:s' - intl: 'H:mm:ss' status: '1' langcode: en locked: '1' +locales: { } +pattern: + php: 'H:i:s' + intl: 'H:mm:ss' diff --git a/core/modules/system/config/system.date_format.html_week.yml b/core/modules/system/config/system.date_format.html_week.yml index 49ff980..aa45e8e 100644 --- a/core/modules/system/config/system.date_format.html_week.yml +++ b/core/modules/system/config/system.date_format.html_week.yml @@ -1,8 +1,10 @@ id: html_week +uuid: d14737ae-d1e0-436b-9225-37113d4c8c7c label: 'HTML Week' -pattern: - php: 'Y-\WW' - intl: 'Y-''W''WW' status: '1' langcode: en locked: '1' +locales: { } +pattern: + php: Y-\WW + intl: 'Y-''W''WW' diff --git a/core/modules/system/config/system.date_format.html_year.yml b/core/modules/system/config/system.date_format.html_year.yml index 2c8b3d5..731cc5f 100644 --- a/core/modules/system/config/system.date_format.html_year.yml +++ b/core/modules/system/config/system.date_format.html_year.yml @@ -1,8 +1,10 @@ id: html_year +uuid: a43b8034-a2f2-4507-9400-bed7d389265f label: 'HTML Year' -pattern: - php: 'Y' - intl: 'Y' status: '1' langcode: en locked: '1' +locales: { } +pattern: + php: Y + intl: Y diff --git a/core/modules/system/config/system.date_format.html_yearless_date.yml b/core/modules/system/config/system.date_format.html_yearless_date.yml index ae29991..29240b2 100644 --- a/core/modules/system/config/system.date_format.html_yearless_date.yml +++ b/core/modules/system/config/system.date_format.html_yearless_date.yml @@ -1,8 +1,10 @@ id: html_yearless_date +uuid: 623ab5ae-ebba-42cc-b100-a4ca10c77b2e label: 'HTML Yearless date' -pattern: - php: 'm-d' - intl: 'MM-d' status: '1' langcode: en locked: '1' +locales: { } +pattern: + php: m-d + intl: MM-d diff --git a/core/modules/system/config/system.date_format.long.yml b/core/modules/system/config/system.date_format.long.yml index 9eebff4..4c632c5 100644 --- a/core/modules/system/config/system.date_format.long.yml +++ b/core/modules/system/config/system.date_format.long.yml @@ -1,7 +1,10 @@ id: long +uuid: 500ad047-44b4-429f-9b00-d54df9cbaa8c label: 'Default long date' +status: '1' +langcode: en +locked: '0' +locales: { } pattern: php: 'l, F j, Y - H:i' intl: 'EEEE, LLLL d, yyyy - kk:mm' -status: '1' -langcode: en diff --git a/core/modules/system/config/system.date_format.medium.yml b/core/modules/system/config/system.date_format.medium.yml index 0390e88..35946a8 100644 --- a/core/modules/system/config/system.date_format.medium.yml +++ b/core/modules/system/config/system.date_format.medium.yml @@ -1,7 +1,10 @@ id: medium +uuid: 17a8d708-e3b1-432d-9d36-542a97346a60 label: 'Default medium date' +status: '1' +langcode: en +locked: '0' +locales: { } pattern: php: 'D, m/d/Y - H:i' intl: 'ccc, MM/dd/yyyy - kk:mm' -status: '1' -langcode: en diff --git a/core/modules/system/config/system.date_format.short.yml b/core/modules/system/config/system.date_format.short.yml index 7a2bc8e..e72c134 100644 --- a/core/modules/system/config/system.date_format.short.yml +++ b/core/modules/system/config/system.date_format.short.yml @@ -1,7 +1,10 @@ id: short +uuid: a8ee7b86-5ef8-43a5-b200-d2e40e10cd58 label: 'Default short date' +status: '1' +langcode: en +locked: '0' +locales: { } pattern: php: 'm/d/Y - H:i' intl: 'MM/dd/yyyy - kk:mm' -status: '1' -langcode: en diff --git a/core/modules/system/lib/Drupal/system/Form/DateFormatLocalizeResetForm.php b/core/modules/system/lib/Drupal/system/Form/DateFormatLocalizeResetForm.php index c8356c5..d3de481 100644 --- a/core/modules/system/lib/Drupal/system/Form/DateFormatLocalizeResetForm.php +++ b/core/modules/system/lib/Drupal/system/Form/DateFormatLocalizeResetForm.php @@ -102,7 +102,7 @@ public function buildForm(array $form, array &$form_state, $langcode = NULL, Req * {@inheritdoc} */ public function submitForm(array &$form, array &$form_state) { - foreach (config_get_storage_names_with_prefix('locale.config.' . $this->language->id . '.system.date_format') as $config_id) { + foreach (config_get_storage_names_with_prefix('locale.config.' . $this->language->id . '.system.date_format.') as $config_id) { $this->configFactory->get($config_id)->delete(); } diff --git a/core/modules/system/lib/Drupal/system/Plugin/Core/Entity/DateFormat.php b/core/modules/system/lib/Drupal/system/Plugin/Core/Entity/DateFormat.php index d7ba718..badf567 100644 --- a/core/modules/system/lib/Drupal/system/Plugin/Core/Entity/DateFormat.php +++ b/core/modules/system/lib/Drupal/system/Plugin/Core/Entity/DateFormat.php @@ -101,8 +101,8 @@ public function getExportProperties() { $properties = parent::getExportProperties(); $names = array( 'locked', - 'pattern', 'locales', + 'pattern', ); foreach ($names as $name) { $properties[$name] = $this->get($name); diff --git a/core/modules/system/system.admin.inc b/core/modules/system/system.admin.inc index e103c79..a6611c1 100644 --- a/core/modules/system/system.admin.inc +++ b/core/modules/system/system.admin.inc @@ -1387,9 +1387,9 @@ function system_date_format_localize_form($form, &$form_state, $langcode) { } // Get configured formats for each language. - $config_prefix = 'locale.config.' . $langcode . '.system.date_format'; + $config_prefix = 'locale.config.' . $langcode . '.system.date_format.'; foreach (config_get_storage_names_with_prefix($config_prefix) as $config_id) { - $date_format_id = substr($config_id, strlen($config_prefix. '.')); + $date_format_id = substr($config_id, strlen($config_prefix)); $choices[$date_format_id] = $date_service->format(REQUEST_TIME, $date_format_id); } diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/field/Date.php b/core/modules/views/lib/Drupal/views/Plugin/views/field/Date.php index 58fd587..5925990 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/field/Date.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/field/Date.php @@ -26,14 +26,14 @@ class Date extends FieldPluginBase { * * @var \Drupal\Core\Datetime\Date */ - protected $date; + protected $dateService; /** * The date format storage. * * @var \Drupal\Core\Entity\EntityStorageControllerInterface */ - protected $dateStorage; + protected $dateFormatStorage; /** * Constructs a new Date object. @@ -44,16 +44,16 @@ class Date extends FieldPluginBase { * The plugin ID for the plugin instance. * @param array $plugin_definition * The plugin implementation definition. - * @param \Drupal\Core\Datetime\Date $date + * @param \Drupal\Core\Datetime\Date $date_service * The date service. - * @param \Drupal\Core\Entity\EntityStorageControllerInterface $date_storage + * @param \Drupal\Core\Entity\EntityStorageControllerInterface $date_format_storage * The date format storage. */ - public function __construct(array $configuration, $plugin_id, array $plugin_definition, DateService $date, EntityStorageControllerInterface $date_storage) { + public function __construct(array $configuration, $plugin_id, array $plugin_definition, DateService $date_service, EntityStorageControllerInterface $date_format_storage) { parent::__construct($configuration, $plugin_id, $plugin_definition); - $this->date = $date; - $this->dateStorage = $date_storage; + $this->dateService = $date_service; + $this->dateFormatStorage = $date_format_storage; } /** @@ -82,8 +82,8 @@ protected function defineOptions() { public function buildOptionsForm(&$form, &$form_state) { $date_formats = array(); - foreach ($this->dateStorage->loadMultiple() as $machine_name => $value) { - $date_formats[$machine_name] = t('@name format: @date', array('@name' => $value->label(), '@date' => $this->date->format(REQUEST_TIME, $machine_name))); + foreach ($this->dateFormatStorage->loadMultiple() as $machine_name => $value) { + $date_formats[$machine_name] = t('@name format: @date', array('@name' => $value->label(), '@date' => $this->dateService->format(REQUEST_TIME, $machine_name))); } $form['date_format'] = array(