diff --git a/composer.json b/composer.json index ab971df..9f2b772 100644 --- a/composer.json +++ b/composer.json @@ -61,7 +61,7 @@ "Fix PHP 8.2 deprecation notices": "https://www.drupal.org/files/issues/2023-05-22/3343964-5.patch" }, "drupal/core": { - "Users can't reference unpublished content even when they have access to it. See https://www.drupal.org/project/drupal/issues/2845144": "https://www.drupal.org/files/issues/2024-01-07/2845144-78.patch" + "Users can't reference unpublished content even when they have access to it. See https://www.drupal.org/project/drupal/issues/2845144": "https://www.drupal.org/files/issues/2024-02-13/2845144-87.patch" } } } diff --git a/config/install/core.date_format.long.yml b/config/install/core.date_format.long.yml index 42c6d12..6d07530 100644 --- a/config/install/core.date_format.long.yml +++ b/config/install/core.date_format.long.yml @@ -4,4 +4,4 @@ dependencies: { } id: long label: 'Default long date' locked: false -pattern: 'l j F Y - g:ia' +pattern: 'l j F Y \a\t g:ia' diff --git a/config/install/core.date_format.medium.yml b/config/install/core.date_format.medium.yml index 9012ea8..333fa78 100644 --- a/config/install/core.date_format.medium.yml +++ b/config/install/core.date_format.medium.yml @@ -4,4 +4,4 @@ dependencies: { } id: medium label: 'Default medium date' locked: false -pattern: 'D, d/m/Y - g:ia' +pattern: 'D d/m/Y g:ia' diff --git a/config/install/core.date_format.short.yml b/config/install/core.date_format.short.yml index 6ef9b80..a31214c 100644 --- a/config/install/core.date_format.short.yml +++ b/config/install/core.date_format.short.yml @@ -4,4 +4,4 @@ dependencies: { } id: short label: 'Default short date' locked: false -pattern: 'd/m/Y - g:ia' +pattern: 'd/m/Y g:ia' diff --git a/localgov.install b/localgov.install index b78b971..7b2eb11 100644 --- a/localgov.install +++ b/localgov.install @@ -55,3 +55,25 @@ function localgov_update_9501() { \Drupal::service('theme_installer')->install(['stable9']); } } + +/** + * Update default date formats to GDS if they haven't been changed. + */ +function localgov_update_9502() { + $config_factory = \Drupal::configFactory(); + $config = $config_factory->getEditable('core.date_format.long'); + if ($config->get('pattern') == 'l j F Y - g:ia') { + $config->set('pattern', 'l j F Y \a\t g:ia'); + $config->save(TRUE); + } + $config = $config_factory->getEditable('core.date_format.medium'); + if ($config->get('pattern') == 'D, d/m/Y - g:ia') { + $config->set('pattern', 'D d/m/Y g:ia'); + $config->save(TRUE); + } + $config = $config_factory->getEditable('core.date_format.short'); + if ($config->get('pattern') == 'd/m/Y - g:ia') { + $config->set('pattern', 'd/m/Y g:ia'); + $config->save(TRUE); + } +}