Bug #71191
closed
format.date - names are not translated
Added by Stephan Bauer about 9 years ago.
Updated about 9 years ago.
Description
When using format.date like this
<f:format.date format="l, d.m.Y">{event.date}</f:format.date>
names like month or day are always in english.
Using it like this it names are translated:
<f:format.date format="%A, %d.%m.%Y">{event.date}</f:format.date>
Would it be possible to use translation in both ways?
Also it would be great to define a default date format.
The two formats use two different ways of php (1. DateFormat->format(); 2. strftime). The first one does only use English (http://php.net/manual/en/datetime.format.php#refsect1-datetime.format-notes) and the second one is localizable. So I think to localize both would be breaking to php in some way.
The second part about defining a default format would be cool :) (And yes I know the current default is Y-m-d), but it would be great to set something like this within typoscript.
- Status changed from New to Rejected
Already possible - from documentation:
Localized dates using strftime date format
<f:format.date format="%d. %B %Y">{dateObject}</f:format.date>
Output
13. Dezember 1980
(depending on the current date and defined locale. In the example you see the 1980-12-13 in a german locale)
Would it be possible to use translation in both ways?
No, unfortunately not. One method uses date() the other uses strftime() and those two work quite differently. The date() format can't be used in strftime() and vice versa.
Also it would be great to define a default date format.
You should definitely do this using a {settings.foobar} variable. There are a few hinges preventing use of a default date format (unless you can indicate a cross-platform safe system option?). The issue is that it's an edge we would rather want to avoid - defining default behaviors of ViewHelpers using TypoScript. That being said, I will definitely consider a feature that would let you override default argument values - but I'm afraid you have to be a bit patient about that one; it would have to be in the standalone Fluid that won't be available as dependency until TYPO3 8. Once that hits you'll have a way to do this via the View (subsequently via the controller, possibly configured through TypoScript as a TYPO3-specific Fluid feature).
Also available in: Atom
PDF