CoreCommunity ExtensionsDistributionsFeature-RequestsTYPO3 6.2 Projects (+)(Archived Projects)

Task #14085

translate newsItem.datetime in FE

Added by Josef Glatz over 4 years ago. Updated over 4 years ago.

Status:Resolved Start date:2011-03-28
Priority:Must have Due date:
Assigned To:- % Done:

100%

Category:-
Target version:1.0.0
TYPO3 Version: Branch:
PHP Version: Complexity:
Has patch:

Description

Actually when using FLUID:

<f:format.date format="l, d. F Y">{newsItem.datetime}</f:format.date>
the output isn't localized.

I found also an possible solution (provided by Nikolas):
http://www.toco3.com/de/toco3_blog/blog-post/2011/02/03/wochentag-lokalisiert-mit-fluid-aus-einem-datetime-objekt-ausgeben.html

But is this solution the final solution in FLUID to make localized week-names?

Thx in advance


Related issues

related to TYPO3.Fluid - Story #5583: DateFormat View Helper doesn't respect locale setting Closed 2009-11-30

History

#1 Updated by Josef Glatz over 4 years ago

My workaround until there's a quicker solution:

Create a typoscript TEXT object and use the f:cObject view helper
to format the date with strftime.

This could look like this in Fluid when using PHP 5.3 or your own
DateTime Class:

<f:CObject typoscriptObjectPath="lib.news2.dateViaTS">{newsItem.datetime}</f:CObject>

lib.news2.dateViaTS = TEXT
lib.news2.dateViaTS {
current = 1
strftime = #gewünschte Ausgabe#
}

That way you can handle your dates in your extension globally, so you
don't need to change countless f:format.date tags.

If you don't use PHP 5.3 or an own DateTime class you can workaround it
this way in Fluid:

<f:CObject typoscriptObjectPath="lib.news2.dateViaTS"><f:format.date
format="U">{date}</f:format.date></f:CObject>

#2 Updated by Josef Glatz over 4 years ago

THX georg!

Solution

<n:format.date format="%A, %d. %B %y">{newsItem.datetime}</n:format.date>

#3 Updated by Georg Ringer over 4 years ago

  • Status changed from New to Resolved
  • Target version set to 1.0.0
  • % Done changed from 0 to 100

Also available in: Atom PDF