[FLOW3-general] DateTime in a TextField

Thomas Plessis t.plessis at totemnumerique.com
Fri Apr 6 15:06:39 CEST 2012


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