cakephp/localized

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

Closed this issue · 6 comments

I know we can pass format to date method in Validation lib, but I think we can help newcomers adding all of widely used data types (like date and decimals) with different formats in differents countrys to that lib.

So, would do you think be nice to provide a 'date' and 'number' validation rule with default normalized format?

I can do a PR if are some interest

This would be the time now to support any changes to the interfaces as PR.
Before we release RC and stable for the Cake4 version.

Thanks, I'll begin that today.

Thinking about how to implement the localized rules for date/decimal.

Should I require extension intl and re-implement some of parser routines from Cake\I18n or add Cake\I18n as a requirement of this plugin?

Neither.
If people are using the the validation part here, they will already have those requirements met.

If this plugin needs those, then require-dev would suffice.

Working on that feature, I found a bug/not expected behavior on Cake\I18n. Now, should I wait for a fix or try another path?

Also, opened a PR to expose my thoughts - review/suggestions are welcome.