These are some use-cases that I think Text Mask should provide addons for:
DD/MM/YYYY (#185)I also requesting country code(1-3 symbols) in phone mask. Phone mask is one of main features but current syntax to realize this is terrible.
@vadimzham I don't quite understand what you're requesting? Could you explain please?
@msafi sure. Below is example:
USA phone: +1 (555) 495-3947 - country code 1 symbol
Japan phone: +81 (555) 495-3947 - country code 2 symbols
Ukraine phone: +380 (555) 495-3947 - country code 3 symbols
I requiring to make universal mask where all these numbers will be valid.
@vadimzham just note that many countries don't have area codes, so I'm not sure if this is easy to write. A danish phone number looks like this:
+45 23 45 67 89
@mzedeler international phone number format is country-code + 10-digits.
Here are only few countries that doesn't match that format.
In regards to a mask per country for phone numbers. It would be possible to dynamically output masks for a selected country by using the data provided by Google libphonenumber: https://github.com/googlei18n/libphonenumber
With an example of the library in action: https://rawgit.com/googlei18n/libphonenumber/master/javascript/i18n/phonenumbers/demo-compiled.html
Here's an example of a library that already uses that data to dynamically change the placeholder. We could go one step further and create the mask per country as well: https://github.com/jackocnr/intl-tel-input
I followed this example and works great.
Most helpful comment
@msafi sure. Below is example:
USA phone:
+1 (555) 495-3947- country code 1 symbolJapan phone:
+81 (555) 495-3947- country code 2 symbolsUkraine phone:
+380 (555) 495-3947- country code 3 symbolsI requiring to make universal mask where all these numbers will be valid.