Skip to content
Snippets Groups Projects
Commit 8dbc3f3c authored by catch's avatar catch
Browse files

Issue #3439440 by nicxvan, Binoli Lalani, longwave: Remove country support from DateFormatter

parent c9879d2d
No related branches found
No related tags found
No related merge requests found
...@@ -117,7 +117,6 @@ public function format($timestamp, $type = 'medium', $format = '', $timezone = N ...@@ -117,7 +117,6 @@ public function format($timestamp, $type = 'medium', $format = '', $timezone = N
// Create a DrupalDateTime object from the timestamp and timezone. // Create a DrupalDateTime object from the timestamp and timezone.
$create_settings = [ $create_settings = [
'langcode' => $langcode, 'langcode' => $langcode,
'country' => $this->country(),
]; ];
$date = DrupalDateTime::createFromTimestamp($timestamp, $this->timezones[$timezone], $create_settings); $date = DrupalDateTime::createFromTimestamp($timestamp, $this->timezones[$timezone], $create_settings);
...@@ -347,8 +346,13 @@ protected function dateFormat($type, $langcode) { ...@@ -347,8 +346,13 @@ protected function dateFormat($type, $langcode) {
* *
* @return string * @return string
* The config setting for country.default. * The config setting for country.default.
*
* @deprecated in drupal:10.3.0 and is removed from drupal:11.0.0. There will be a contrib replacement. See https://www.drupal.org/node/3439484
*
* @see https://www.drupal.org/node/3439484
*/ */
protected function country() { protected function country() {
@trigger_error('Calling ' . __METHOD__ . '() is deprecated in drupal:10.3.0 and is removed from drupal:11.0.0. There is no replacement. See https://www.drupal.org/node/3439484', E_USER_DEPRECATED);
if ($this->country === NULL) { if ($this->country === NULL) {
$this->country = \Drupal::config('system.date')->get('country.default'); $this->country = \Drupal::config('system.date')->get('country.default');
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment