amberframework / amber

A Crystal web framework that makes building applications fast, simple, and enjoyable. Get started with quick prototyping, less bugs, and blazing fast performance.
https://amberframework.org
MIT License
2.57k stars 205 forks source link

Add México to the PHONE_FORMAT locale list #1268

Closed renich closed 2 years ago

renich commented 2 years ago

Description of the Change

It's a simple check but enough for now until we figure out the exact regex. It will be complicated, though, since I couldn't find a full list online and asking Telmex is going to be a pain...

Alternate Designs

If Telmex provides a full list, we can devise the exact RegEx required for a true validation.

Benefits

We will have a mexican phone locale available.

Possible Drawbacks

The check will allow any 10 digit number with or without +52 (the country code). You can, still, enter bogus phones and they will pass unnoticed.

crimson-knight commented 2 years ago

Wouldn't Mexico be covered by the North American phone number format? The US, Canada and Mexico all use the same formatting for phone numbers.

crimson-knight commented 2 years ago

Nevermind, I see that isn't in here now that I look more closely.

renich commented 2 years ago

Yeah, it wouldn't. I'm, actually, having issues with this. This is why I've decided to go for a simplified RegEx for now.