Is there a use case that justifies the added complexity of having separate custom and default datetime formatters?
Instead we could just add 'custom' to the select list of available formats on the default formatter, and expose the custom input textbox if 'custom' is selected. The UI is not any more cluttered for novice users, and no great damage can be done to the site by a user entering an invalid format.
Having these formatters as separate
a) increases the maintenance burden of core (especially as these are duplicated in date_range)
and
b) makes life harder for anyone wanting to extend a formatter as they may find they have to extend both in identical ways to cover all their needs
Comments
Comment #2
mpdonadioI somewhat agree with this in spirit, but we would have to keep both versions around for BC, and it would be a update path nightmare at this point.
Not really sure this would reduce testing complexity, because even if we merged them, we would still have to test both paths through the formatters (using the dateforamt config entities and the custom format strings).
#2793143: The datetime and daterange formatters (except plain) should use the HTML time element will go a way to make testing the formatters easier, as the markup will be more consistent across all of them.
Comment #3
jonathanshawIt seems like a 2 stage thing:
1) Add the custom functionality to default, and deprecate the custom.
2) In 9.x, remove custom
The question is when to do 1). Anytime from now, or only in 9.x?
Comment #4
jhedstromWe could probably do something like the following in 8.x:
Comment #17
smustgrave commentedThank you for creating this issue to improve Drupal.
We are working to decide if this task is still relevant to a currently supported version of Drupal. There hasn't been any discussion here for over 8 years which suggests that this has either been implemented or is no longer relevant. Your thoughts on this will allow a decision to be made.
Since we need more information to move forward with this issue, the status is now Postponed (maintainer needs more info). If we don't receive additional information to help with the issue, it may be closed after three months.
Thanks!