[TYPO3-mvc] format.date not converting from timestamp?

Simon Schaufelberger (Schaufi) simonschaufi at jesus.de
Sat Mar 12 17:35:29 CET 2011


> {f:format.date(date: '@{labor.start}', format: 'd.m.Y')}

indeed, this works for me as also. i am quite sure i tried this notation 
but well, looks like it was my fault somehow.

ok, but this notation does not work for me:

<f:form.textbox value="{'@{labor.start}' -> f:format.date(format: 
'd.m.Y')}" />

does it work for you?

Regards, Schaufi

Am 12.03.2011 01:50, schrieb Thomas Allmer:
> strange... works just fine for me...
>
> {f:format.date(date: '@{labor.start}', format: 'd.m.Y')}
>
> == Model ==
> /**
> * @var integer $start
> * @validate NotEmpty
> */
> protected $start;
>
> == ext_tables.php ==
> start int(11) DEFAULT '0' NOT NULL,
>
> == TCA ==
> 'start' => array(
> 'exclude' => 0,
> 'label' => 'start',
> 'config' => array(
> 'type' => 'input',
> 'size' => 12,
> 'max' => 20,
> 'eval' => 'datetime,required',
> 'checkbox' => '0',
> 'default' => '0'
> ),
> ),
>
> On 12.03.2011 00:18, Simon Schaufelberger wrote:
>> also tried that but then the filter.filterValueTo is not parsed.
>>
>> Am 12.03.2011 00:14, schrieb Thomas Allmer:
>>> how about...
>>>
>>> {f:format.date(date: '@{filter.filterValueTo}', format: 'd.m.Y')}
>>>
>>> On 11.03.2011 21:32, Simon Schaufelberger wrote:
>>>> Hi,
>>>> What is the corresponding inline notation for that?
>>>> i am struggeling with it but i don't get it working.
>>>> i tried:
>>>>
>>>> {@{filter.filterValueTo} -> f:format.date(format: 'd.m.Y')}
>>>> {@filter.filterValueTo -> f:format.date(format: 'd.m.Y')}
>>>> {f:format.date(date: @{filter.filterValueTo, format: 'd.m.Y'})}
>>>> {f:format.date(date: @filter.filterValueTo, format: 'd.m.Y')}
>>>>
>>>> Am 19.11.2010 18:18, schrieb Bastian Waidelich:
>>>>> Sy Moen wrote:
>>>>>
>>>>>> I have typo3 4.5alpha 3 installed... and the ViewHelper for
>>>>>> format.date
>>>>>> (DateViewHelper.php) throws the, "could not be parsed by DateTime
>>>>>> constructor." error because the $date is a timestamp... which is
>>>>>> how it
>>>>>> is stored in the db...
>>>>>
>>>>> Hi Sy ;)
>>>>>
>>>>> Apart from passing a DateTime object you can use all formats from
>>>>> http://de3.php.net/manual/de/datetime.formats.php
>>>>> Unix timestamps have to be prepended with "@"
>>>>>
>>>>> try:
>>>>> <f:format.date format="Y-m-d">@{yourTimestamp}</f:format.date>
>>>>>
>>>>> HTH
>>>>> Bastian
>>>>
>>>
>>>
>>
>
>


More information about the TYPO3-project-typo3v4mvc mailing list