Bug #58972

DateViewHelper property "forceLocale" not passed as boolean

Added by Carsten Bleicker about 1 year ago. Updated about 1 year ago.

Status:Closed Start date:2014-05-20
Priority:Should have Due date:
Assigned To:Bastian Waidelich % Done:

0%

Category:ViewHelpers
Target version:-
Has patch:No Affected Flow version:Git master

Description

As far as i understand this should check localisationService.
<f:format.date forceLocale="true">{document.dateTime}</f:format.date>

But boolean is not realy passed to \TYPO3\Fluid\Core\ViewHelper\AbstractLocaleAwareViewHelper::getLocale?

History

#1 Updated by Carsten Bleicker about 1 year ago

Results in:
"true" is not a valid locale identifier. (20140520201641f4700c)

#2 Updated by Bastian Waidelich about 1 year ago

  • Category set to ViewHelpers
  • Status changed from New to Needs Feedback
  • Assigned To set to Bastian Waidelich

Because the "forceLocale" argument is of type "mixed" there is no type conversion taking place (one reason why we should avoid mixed type hints..).
Try

1<f:format.date forceLocale="{true}">{document.dateTime}</f:format.date>

or

1{document.dateTime -> f:format.date(forceLocale: true)}

#3 Updated by Carsten Bleicker about 1 year ago

Thank you bastian!
It works:
<f:format.date forceLocale="{true}" localeFormatType="date">{dateTime}</f:format.date>

Can you close this issue?

#4 Updated by Bastian Waidelich about 1 year ago

  • Status changed from Needs Feedback to Closed

Carsten Bleicker wrote:

Can you close this issue?

Yes, thanks for the feedback ;)

Also available in: Atom PDF