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.
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | byebye-format-date-modules-3008494-6.patch | 15.13 KB | jcnventura |
| #6 | interdiff.txt | 944 bytes | jcnventura |
Comments
Comment #2
jcnventuraComment #3
jcnventuraLet'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.
Comment #4
jcnventuraComment #6
jcnventuraForgot to switch to double quotes when I copied the deprecation message into the @trigger_error, as it included single quotes.
Comment #8
alexpottThe 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()