New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
getAsYouTypeFormatter missing #87
Comments
Hi, What's the point of an As You Type Formatter for PHP? If you are doing it via a web form, then you would need to send an AJAX
|
Hi! Using $phoneUtil->format on "1555245" gives me these results: Currently, I am unaware of a way to get "1 555-245" from "1555245". If you know one, please let me know. |
Sorry, but I still don't see the use case. I can't think of a reason you would need to format a partially input number, unless you are expecting further input. |
Closing issue. I'll be happy to re-open it if you can convince me of a use case. |
@giggsey one case is getting all possible prefixes for country, I guess. |
The AsYouTypeFormatter wouldn't help there though, because it wouldn't format the number until you hit a valid number. |
I don't think that's actually possible. You can get the patterns for each number type, but you'll have to work out the prefix by yourself. |
Reopening, as I'm going to implement this. |
@giggsey that's good 👍 |
Hello !
I saw that the getAsYouTypeFormatter functionality is missing from your package. :(
It is present it the official Google library (v7.1.0).
Can you please implement it?
I am refering to this:
Formatting Phone Numbers 'as you type'
PhoneNumberUtil phoneUtil = PhoneNumberUtil.getInstance();
AsYouTypeFormatter formatter = phoneUtil.getAsYouTypeFormatter("US");
System.out.println(formatter.inputDigit('6')); // Outputs "6"
... // Input more digits
System.out.println(formatter.inputDigit('3')); // Now outputs "650 253"
The text was updated successfully, but these errors were encountered: