[TYPO3-mvc] format.date not converting from timestamp?
Thomas Allmer
at at delusionworld.com
Sat Mar 12 01:50:43 CET 2011
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
>>>
>>
>>
>
--
+---------------------------------+-----------------------------------+
| Thomas Allmer | http://www.delusionworld.com |
| E-mail: at at delusionworld.com | phone: +43 699 16217064 |
+---------------------------------+-----------------------------------+
More information about the TYPO3-project-typo3v4mvc
mailing list