[FLOW3-general] DateTime in a TextField

"Christian Müller (FLOW3 Team)" christian.mueller at typo3.org
Sat Apr 7 00:03:35 CEST 2012


Hi Thomas,

the initializeEditAction has not much to do with form display, you have 
basically two options, you don't use property binding but a simple name 
based input and do an f:format.date on the value before, or you take a 
look at the conference package, it features a DateTime input viewhelper 
which does that for you.

Cheers,
Christian

On 06/04/12 15:06, Thomas Plessis wrote:
> Hi guys!
>
> How to display a DateTime object in a texfiield using property mapping? I got the following error :
>
> #1: Warning: htmlspecialchars() expects parameter 1 to be string, object given in /var/www/clients/client18/web54/web/Data/Temporary/Development/Cache/Code/FLOW3_Object_Classes/TYPO3_Fluid_Core_ViewHelper_TagBuilder_Original.php line 140
>
> By using TypeConverter? I've do that on the initialize method of my action :
>
> 	public function initializeEditAction() {
> 	    $this->arguments['event']
> 	        ->getPropertyMappingConfiguration()
> 	        ->forProperty('startDate')
> 	        ->setTypeConverterOption('Totem\Accor\Property\TypeConverter\DateTimeConverter', \TYPO3\FLOW3\Property\TypeConverter\DateTimeConverter::CONFIGURATION_DATE_FORMAT, 'd-m-Y');
> 	   	$this->arguments['event']
> 	        ->getPropertyMappingConfiguration()
> 	        ->forProperty('endDate')
> 	        ->setTypeConverterOption('Totem\Accor\Property\TypeConverter\DateTimeConverter', \TYPO3\FLOW3\Property\TypeConverter\DateTimeConverter::CONFIGURATION_DATE_FORMAT, 'd-m-Y');
> 	}
>
> What's wrong?
>
> regards,
>
> Thomas Plessis
> Développeur multimédia
> --
> TOTEMnumerique
> 9, Place St Étienne
> 31000 Toulouse
> T. 05 61 14 64 54
> F. 05 61 14 64 55
>




More information about the FLOW3-general mailing list