[TYPO3-mvc] Validating Datetime field
Douwe Doornbos
d.doornbos at rug.nl
Wed Oct 5 14:09:32 CEST 2016
Unfortunately I did not succeed.
I have this in my initializeUpdateAction() and initializeCreateAction() :
$this->arguments['betaalopdracht']
->getPropertyMappingConfiguration()
->forProperty('geboortedatum')
->setTypeConverterOption('TYPO3\\CMS\\Extbase\\Property\\TypeConverter\\DateTimeConverter', \TYPO3\CMS\Extbase\Property\TypeConverter\DateTimeConverter::CONFIGURATION_DATE_FORMAT, 'd-m-Y');
Domain model:
/**
* geboortedatum
*
* @var \DateTime
* @validate DateTime
*/
protected $geboortedatum = '';
TCA:
'geboortedatum' => array(
'exclude' => 1,
'label' => 'LLL:EXT:fef/Resources/Private/Language/locallang_db.xlf:tx_fef_domain_model_betaalopdracht.geboortedatum',
'config' => array(
'dbType' => 'date',
'type' => 'input',
'size' => 7,
'eval' => 'date',
),
But is does not work. F.e. 34-34-2000 gets converted and saved as 03-11-2002. No error messages. Although I see a message when I enter 'a' in the date field: The date "a" was not recognized (for format "d-m-Y").
I'm sad :-(
Regards, Douwe.
More information about the TYPO3-project-typo3v4mvc
mailing list