ng2-validation icon indicating copy to clipboard operation
ng2-validation copied to clipboard

Issue with CustomValidators.phone('de-CH')

Open AndrinGautschi opened this issue 7 years ago • 2 comments

Validation of a 'ch-DE' phone number isn't working with current version 4.2.0. It fails after three digits.

Workaround is setting version back to 3.9.1

AndrinGautschi avatar Aug 23 '17 19:08 AndrinGautschi

I had a similar issue with 'en-IN'. It was fixed by using 'IN' instead of 'en-IN'. Apparently, country metadata inside libphonenumber-js expects it in this format.

baljeet avatar Sep 25 '17 04:09 baljeet

@baljeet I already did that and it worked but the resulting validation was crappy. It didn't check for chars like 'A' or 'W' and the phone number was valid after a certain amount of characters.

AndrinGautschi avatar Sep 25 '17 12:09 AndrinGautschi