{"action":"created","issue":{"url":"https://api.github.com/repos/floere/phony/issues/229","labels_url":"https://api.github.com/repos/floere/phony/issues/229/labels{/name}","comments_url":"https://api.github.com/repos/floere/phony/issues/229/comments","events_url":"https://api.github.com/repos/floere/phony/issues/229/events","html_url":"https://github.com/floere/phony/issues/229","id":59882038,"number":229,"title":"US phone number :national format replacement?","user":{"login":"bdmac","id":47326,"avatar_url":"https://avatars.githubusercontent.com/u/47326?v=3","gravatar_id":"","url":"https://api.github.com/users/bdmac","html_url":"https://github.com/bdmac","followers_url":"https://api.github.com/users/bdmac/followers","following_url":"https://api.github.com/users/bdmac/following{/other_user}","gists_url":"https://api.github.com/users/bdmac/gists{/gist_id}","starred_url":"https://api.github.com/users/bdmac/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bdmac/subscriptions","organizations_url":"https://api.github.com/users/bdmac/orgs","repos_url":"https://api.github.com/users/bdmac/repos","events_url":"https://api.github.com/users/bdmac/events{/privacy}","received_events_url":"https://api.github.com/users/bdmac/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-03-04T23:46:53Z","updated_at":"2015-03-05T00:09:28Z","closed_at":null,"body":"We just updated our Phony gem from 2.2.13 to 2.11.1 to take advantage of some fixes. We also use phony_rails' phony_formatted string helper which pretty much just passes through to Phony. Somewhere between those versions the :national format helper changed (at least for US numbers).\r\n\r\nIn 2.2.13:\r\n```ruby\r\n\"14152223333\"..phony_formatted(format: :national, spaces: '-') # => \"415-222-3333\"\r\n```\r\nbut now in 2.11.1:\r\n```ruby\r\n\"14152223333\"..phony_formatted(format: :national, spaces: '-') # => \"1-415-222-3333\"\r\n```\r\n\r\nOn our site we present a form with the country code as a separate drop down to try to better ensure valid phone numbers are collected. I want to be able to show the country code as +1 in the drop down and then \"415-222-3333\" in the text field next to the country list.\r\n\r\nWhat format parameter can I pass to get that value again? Both :international and :national for US numbers return basically the same value with the exception of the '+' character being included in international but removed from national."},"comment":{"url":"https://api.github.com/repos/floere/phony/issues/comments/77279278","html_url":"https://github.com/floere/phony/issues/229#issuecomment-77279278","issue_url":"https://api.github.com/repos/floere/phony/issues/229","id":77279278,"user":{"login":"floere","id":3022,"avatar_url":"https://avatars.githubusercontent.com/u/3022?v=3","gravatar_id":"","url":"https://api.github.com/users/floere","html_url":"https://github.com/floere","followers_url":"https://api.github.com/users/floere/followers","following_url":"https://api.github.com/users/floere/following{/other_user}","gists_url":"https://api.github.com/users/floere/gists{/gist_id}","starred_url":"https://api.github.com/users/floere/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/floere/subscriptions","organizations_url":"https://api.github.com/users/floere/orgs","repos_url":"https://api.github.com/users/floere/repos","events_url":"https://api.github.com/users/floere/events{/privacy}","received_events_url":"https://api.github.com/users/floere/received_events","type":"User","site_admin":false},"created_at":"2015-03-05T00:09:28Z","updated_at":"2015-03-05T00:09:28Z","body":"It did change. The newly appearing \"1\" is the trunk prefix.\r\nWhat you could use in the short term is `Phony.split` and use the first element for the drop down, and the rest for the text field.\r\n\r\nI'm not sure yet if it would be a good idea to add a `trunk: false` parameter to the format call (it's too late here) – any ideas?"}}