Remove country support from DateFormatter

Created on 8 April 2024, 9 months ago
Updated 23 April 2024, 9 months ago

Problem/Motivation

DateFormatter has a method to get the default country and pass it into a DrupalDateTime object:

    // Create a DrupalDateTime object from the timestamp and timezone.
    $create_settings = [
      'langcode' => $langcode,
      'country' => $this->country(),
    ];
    $date = DrupalDateTime::createFromTimestamp($timestamp, $this->timezones[$timezone], $create_settings);

Since #2276183: Date intl support is broken, remove it โ†’ DrupalDateTime has not done anything with this information.

Steps to reproduce

N/A

Proposed resolution

Remove the call to country.
Deprecate the country() method.

Remaining tasks

I do not believe this deprecation requires a unit test: getSerializer does not have one and is similarly a protected static method.

User interface changes

N/A

API changes

N/A

Data model changes

N/A

Release notes snippet

๐Ÿ“Œ Task
Status

Fixed

Version

10.3 โœจ

Component
Baseย  โ†’

Last updated about 11 hours ago

Created by

๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom longwave UK

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024