Giter VIP home page Giter VIP logo

Comments (8)

codan84 avatar codan84 commented on June 26, 2024

Example using https://www.npmjs.com/package/google-libphonenumber

> const phoneUtil = require('google-libphonenumber').PhoneNumberUtil.getInstance();
undefined
> phoneUtil.isValidNumberForRegion(phoneUtil.parse('+97148376525', 'AE'), 'AE')
true

from phone.

Bossa573 avatar Bossa573 commented on June 26, 2024

from the data: https://github.com/AfterShip/phone/blob/master/src/data/country_phone_data.ts#L96C3-L97
the input phone number has to be 9-digit
please include sources that describing precisely about the correct phone number length for UAE phone numbers

from phone.

codan84 avatar codan84 commented on June 26, 2024

Data in the link provided must be wrong. The phone number I posted in my initial message is a callable, correct Dubai phone. Go ahead and try it.

from phone.

Bossa573 avatar Bossa573 commented on June 26, 2024

The URL above is indeed the source data of this repo.
And also, please provide any proof / website / pdf showing the phone number format guidelines.
It's unable to know the accurate format of the phone number you provide.
And it is not practical to actually try every phone number in the world.

from phone.

codan84 avatar codan84 commented on June 26, 2024

https://github.com/google/libphonenumber/blob/master/resources/metadata/971/comments.csv
https://www.itu.int/oth/T02020000DC/en
https://www.itu.int/dms_pub/itu-t/oth/02/02/T02020000DC0001PDFE.pdf

Clearly phone numbers can be 8 digit. The source you are using is outdated.

from phone.

codan84 avatar codan84 commented on June 26, 2024

Furthermore, looking at 800 (NDC), numbers can be between 5 and 12 digits long

from phone.

Bossa573 avatar Bossa573 commented on June 26, 2024

The source you are using is outdated.

The source code (https://github.com/AfterShip/phone/blob/master/src/data/country_phone_data.ts#L96C3-L97) would not be proactively updated, by nature eventually it should be outdated, it is the source code, not the "data source" we use 🙂

I will only add "8" to the library at the moment

from phone.

Bossa573 avatar Bossa573 commented on June 26, 2024

Further digging out from the wiki page
https://en.wikipedia.org/wiki/Telephone_numbers_in_the_United_Arab_Emirates

Landline

0x xxx xxxx (8-digits excluding thunk code 0)

Mobile

05x xxx xxxx (9-digits excluding thunk code 0)


This also align with the data source you provided: https://www.itu.int/dms_pub/itu-t/oth/02/02/T02020000DC0001PDFE.pdf
The phone library only supports mobile phone numbers, not landlines,
we would not include those formats in the library.
(Refer to readme: https://github.com/AfterShip/phone#help)

from phone.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.