I need to add a custom validator to the datepicker field. By default, this field comes without any validators.
I've already made the validator settings visible in the TCA of tx_powermail_domain_model_field
and added my custom validator as usual.
Now I need the attributes data-parsley-customXXX
and data-parsley-error-message
added to the HTML input field which is usually done via the the viewhelper in ValidationDataAttributeViewHelper.php
:
https://github.com/einpraegsam/powermail/blob/develop/Classes/ViewHelpers/Validation/ValidationDataAttributeViewHelper.php#L342
https://github.com/einpraegsam/powermail/blob/develop/Classes/ViewHelpers/Validation/ValidationDataAttributeViewHelper.php#L348
This is the code I need to extend: https://github.com/einpraegsam/powermail/blob/develop/Classes/ViewHelpers/Validation/DatepickerDataAttributeViewHelper.php#L32
I found a solution for my problem. As suggested in the comment it's possible to extend the Viewhelper:
ext_localconf.php:
myext/Classes/Powermail/ViewHelpers/Validation/DatepickerDataAttributeViewHelper.php