Skip to content

Conversation

@CauanCabral
Copy link
Contributor

Resolve #186

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

@CauanCabral
Copy link
Contributor Author

As I pointed on cakephp/cakephp#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
Copy link
Member

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?

@CauanCabral CauanCabral force-pushed the feature/ValidationDateNumber branch from 9355f4f to 8c8b825 Compare May 13, 2021 12:39
@dereuromark
Copy link
Member

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
Copy link
Contributor Author

Sure, how can I do that?

@dereuromark
Copy link
Member

dereuromark commented May 13, 2021

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
Copy link
Member

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

@CauanCabral
Copy link
Contributor Author

@dereuromark I think its done.

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

Thanks.

@dereuromark dereuromark merged commit d3a8a8a into cakephp:master May 14, 2021
@dereuromark
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Include a localized 'date' and 'number' rules to ValidationInterface

2 participants