acseo / FormJsValidationBundle

Symfony Form Js Validation Bundle
MIT License
5 stars 1 forks source link

Internationalize date validation #7

Open npotier opened 6 years ago

npotier commented 6 years ago

Hello @romainguerrero. Thanks for your amazing work on this bundle, its really awesome to be able to validate symfony forms with javascript.

I've noticed that date format check is only for french format : https://github.com/acseo/FormJsValidationBundle/blob/8d25f9564ca91d788c34a1c507c70f6a5089ec45/Service/JqueryFormValidator.php#L82

it would be great to get the current locale from the translator service (http://api.symfony.com/2.8/Symfony/Component/Translation/Translator.html#method_getLocale) to determine how to check the date format, or at least make the format configurable.

I would be please to help on this feature.

romainguerrero commented 6 years ago

Thank you for your congratulations @npotier, it's a team work with the ACSEO team (http://www.acseo.fr/)

Yes of course for your proposition, it could be great ! If you have time to do the improvement do not hesitate to make a pull request. I will study it carefully as soon as possible.

You can find all the validations actually supported by the plugin here in addition to the dateISO validation (english format).