Problem/Motivation

As part of #2999721: [META] Deprecate the legacy include files before Drupal 9, deprecate format_date()

Proposed resolution

Replace with calls to DateFormatterInterface::format().

In modules, replace all format_date() calls with \Drupal::service('date.formatter')->format() calls.

Remaining tasks

None.

User interface changes

None.

API changes

None.

Data model changes

None.

Comments

jcnventura created an issue. See original summary.

jcnventura’s picture

Status: Active » Needs review
StatusFileSize
new14.42 KB
jcnventura’s picture

StatusFileSize
new645 bytes
new15.27 KB

Let's also add a trigger_error to the format_date() call, which should be safe after #3008446: Complete the deprecation of format_date() and #3008493: Deprecate format_date() in classes get committed.

jcnventura’s picture

Status: Needs review » Needs work

The last submitted patch, 3: byebye-format-date-modules-3008494-3.patch, failed testing. View results

jcnventura’s picture

Status: Needs work » Needs review
StatusFileSize
new944 bytes
new15.13 KB

Forgot to switch to double quotes when I copied the deprecation message into the @trigger_error, as it included single quotes.

Status: Needs review » Needs work

The last submitted patch, 6: byebye-format-date-modules-3008494-6.patch, failed testing. View results

alexpott’s picture

Status: Needs work » Closed (duplicate)

The splitting of issues like

is against the advice of our scoping recommendations. Let's not do this. See https://www.drupal.org/core/scope

I'm going to combine all the issues to the earliest issue - #3008446: Complete the deprecation of format_date()