react-international-phone icon indicating copy to clipboard operation
react-international-phone copied to clipboard

Format number for The Netherlands

Open jessetan opened this issue 9 months ago • 1 comments

What has been done

The default formatting for phone number from the Netherlands used the format .. ......... That is, a two digit area code followed by the rest of the number.

However area codes can be either two or three digits (plus one if you count the optional 0 which should be omitted in E.164 notation). A full list from the Dutch government is here: https://wetten.overheid.nl/jci1.3:c:BWBR0010198&bijlage=1&z=2022-12-16&g=2022-12-16 The majority of the area codes are three digits and a smaller number have two digits. Notable exceptions are mobile numbers, which always start with 6.

This PR adds formatting for all one and two digit area codes, as well as one, two and three digit area codes with the optional leading 0. If no area code matches, it is assumed to be a three digit area code without leading 0.

Checklist before requesting a review

  • [X] I have read the contributing doc before submitting this PR.
  • [X] Commit titles correspond to the convention.
  • [X] I have performed a self-review of my code.
  • [ ] Tests for the changes have been added (for bug fixes/features).
  • [ ] Docs have been added / updated (for bug fixes / features).

Screenshots (if appropriate):

jessetan avatar May 16 '24 09:05 jessetan

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-international-phone-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 18, 2024 2:25pm
react-international-phone-storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 18, 2024 2:25pm

vercel[bot] avatar May 16 '24 09:05 vercel[bot]

:tada: This PR is included in version 4.3.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

goveo avatar May 18 '24 15:05 goveo

Hi @jessetan!

I'm facing an issue with validating numbers starting from '097'. We're using your phone input to get OTPs and we have users worldwide. But due to formatting numbers like this (+31 97010290042) are not allowed. Disabling formatting doesn't help as well since still number length is validated.

It is said that these numbers are M2M numbers but there are mentions of numbers like the following which say these are being used to get SMS.

https://issuetracker.google.com/issues/74493346#comment6

ThulinaWickramasinghe avatar Sep 12 '24 07:09 ThulinaWickramasinghe