[TYPO3-ttnews] multiple date formats (separate Month/Day)

Mario Šargač sargac at gmail.com
Mon Jan 10 16:03:41 CET 2011


Self-Reply:

the #2 solution works, but the string I used doesn't work on Windows 
(grrrrr:
-------------------
Windows only: The %e modifier is not supported in the Windows 
implementation of this function. To achieve this value, the %#d modifier 
can be used instead. The example below illustrates how to write a cross 
platform compatible function.
-------------------

here's what I wanted and working:

displayLatest {
	date_stdWrap.strftime = %b
	time_stdWrap.strftime = %#d
}

Best,
Mario


On 01/10/2011 03:51 PM, Mario Šargač wrote:
> Hello,
>
> is it possible to separate a "date" field into a "month" and a "day"
> fields in template, so I would get:
>
> <div class="month">###NEWS_MONTH###</div>
> <div class="day">###NEWS_DAY###</div>
>
> ----------- Explanation ---------------
> I tried 2 things, but couldn't achieve the desired effect. First I tried
> with extension "tt_news_genericmarkers", created 2 new markers similar
> in the example above, and following TS Code:
>
> genericmarkers {
> month = TEXT
> month {
> data = date:M
> wrap = |
> }
> day = TEXT
> day {
> data = date:j
> wrap = |
> }
> }
>
> but of course get today's date, instead of a News item's date. If anyone
> knows how to get News item's date, please help.
>
> The other solution #2, I was thinking would be to use existing markers
> from News and customize the format:
>
> displayLatest {
> date_stdWrap.strftime = %b
> time_stdWrap.strftime = %e
> }
>
> but unfortunately the "time_stdWrap.strftime" accepts only "time"
> variables, for example %H, and not #e, which I need, 'though both date_
> and time_ uses strftime formatting.
>
> Best,
> Mario
>
>
>
>
>
>
>


More information about the TYPO3-project-tt-news mailing list