cakephp / localized

I18n and L10n related CakePHP code
Other
213 stars 177 forks source link

Implement methods to validate date and decimal on localized form #204

Closed CauanCabral closed 3 years ago

CauanCabral commented 4 years ago

Resolve #186

Using \Cake\I18n subsystem, validate string of date/datetim or decimal number from your localized form.

CauanCabral commented 4 years ago

As I pointed on https://github.com/cakephp/cakephp/issues/14519, my implementation depends on non-lenient behavior from Date/DateTime parsers. That behavior is available on current 4.1-dev.

How can I meet that? Update composer.json?

dereuromark commented 3 years ago

Yes, we now make a requirement to CakePHP 4.1+ then, which is fine for quite some time now. I like the approach

Are there any other comments/reviews from people so far?

dereuromark commented 3 years ago

I started https://sandbox.dereuromark.de/sandbox/localized Maybe you are interested in also showcasing some of this useful new validation there as "datetime" action or alike?

CauanCabral commented 3 years ago

Sure, how can I do that?

dereuromark commented 3 years ago

PR your addition :) https://github.com/dereuromark/cakephp-sandbox You can use your branch of this repo locally for now, until it is merged and done, and then we can merge with master branch of this one.

dereuromark commented 3 years ago

Once you updated the composer constraint we can also first merge this PR into master.

CauanCabral commented 3 years ago

@dereuromark I think its done.

Next week I expect some more sparse time, so I will make a PR into sandbox too.

Thanks.

dereuromark commented 3 years ago

Cool also the docs here might need some update on this new feature.