We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f11a4a4 commit 6b42030Copy full SHA for 6b42030
demo-contacts.js
@@ -18,8 +18,9 @@ $.extend($.convertFn, {
18
phone: function(value) {
19
// turn a string phone number into a normalized one with dashes
20
// and parens
21
- value = parseInt(value.replace(/[\(\)\- ]/g, ""), 10).toString();
22
- value = ("0000000000" + value).substr(-10);
+ value = (parseInt(value.replace(/[\(\)\- ]/g, ""), 10) || 0).toString();
+ value = "0000000000" + value;
23
+ value = value.substr(value.length - 10);
24
value = "(" + value.substr(0,3) + ") " + value.substr(3,3) + "-" + value.substr(6);
25
return value;
26
},
0 commit comments