Skip to content

Commit

Permalink
Merge pull request #682 from localgovdrupal/3.x
Browse files Browse the repository at this point in the history
PR for 3.0.3
  • Loading branch information
finnlewis authored Feb 27, 2024
2 parents e80aab6 + 571d7a8 commit 9b0f10d
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 4 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion config/install/core.date_format.long.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
2 changes: 1 addition & 1 deletion config/install/core.date_format.medium.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
2 changes: 1 addition & 1 deletion config/install/core.date_format.short.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
22 changes: 22 additions & 0 deletions localgov.install
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

0 comments on commit 9b0f10d

Please sign in to comment.