You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd say yes! For instance, currently I use phony_normalize from phony-rails, which saves a number with a + in DB.
But then, when I try to format it in national format, if I leave the +, I get a Phony::FormattingError: Phony could not format the given number. Is it a phone number? error. So I need to remove the + before passing it to #format.
@capripot Thanks for your input, I appreciate it! 😊
I think the core issue here is that it makes little sense to also store a + in the database, if you only store full E164 conforming numbers (not sure I agree with phony-rails' decision here to leave the + in – but I am missing context, I assume). format is designed to work only on E164 numbers, ie. only the digits. Feel free to call normalize beforehand and call format on the result. Does that help?
Should Phony also handle the + (country calling code indicator) when passed to e.g.
split
?The text was updated successfully, but these errors were encountered: