Remove date/currency/number formatting workarounds in favor of twig_intl [BLOCKED]

Created on 6 February 2024, about 1 year ago

Blocked by Drupal core issue: 🐛 Custom Core Twig Filter "format_date" conflicts with twig/intl-extra Active

Problem/Motivation

Until we ran into this Drupal core issue: 🐛 Custom Core Twig Filter "format_date" conflicts with twig/intl-extra Active which will presumably not be solved within years, we were able to use the twig_intl methods for date/currency/number formatting. Sadly this conflicts with Drupal core's |format_date() filter: 🐛 Twig\Error\RuntimeError: The date format "html_date" does not exist Active

So we needed to remove the simple twig_intl filters and had to do all the formatting ourselves in HOOK_preprocess and for dates using this workaround |date('u')|format_date('short') as Billwerk uses this date format: "2023-12-06T23:00:00.0000000Z"

Related commits:
https://git.drupalcode.org/project/billwerk_subscriptions/-/commit/450fb...
https://git.drupalcode.org/project/billwerk_subscriptions/-/commit/a1487...
https://git.drupalcode.org/project/billwerk_subscriptions/-/commit/011cc...
https://git.drupalcode.org/project/billwerk_subscriptions/-/commit/1f4ce...

So if one day the core issue will be solved, we can simply all this by using the twig filters again, like before.

But as written above, we might be dead until that happens... so this is mainly for documentation of this ugly workaround.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

📌 Task
Status

Postponed

Version

1.0

Component

Code

Created by

🇩🇪Germany Anybody Porta Westfalica

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

Comments & Activities

Production build 0.71.5 2024