From 1a91a8b3e6f6e65a2a355f88de19598f6195bb63 Mon Sep 17 00:00:00 2001 From: Sergey Chernyakov Date: Thu, 16 Jun 2016 12:01:59 +0200 Subject: [PATCH] [Fixes #267] fixes length' of undefined error, russian and german phone numbers --- dist/js/bootstrap-formhelpers.js | 4 ++-- js/bootstrap-formhelpers-phone.js | 1 + js/lang/en_US/bootstrap-formhelpers-phone.en_US.js | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/dist/js/bootstrap-formhelpers.js b/dist/js/bootstrap-formhelpers.js index 9d2da5a..bd0612d 100644 --- a/dist/js/bootstrap-formhelpers.js +++ b/dist/js/bootstrap-formhelpers.js @@ -7965,7 +7965,7 @@ var BFHPhoneFormatList = { 'TF': '+262 ddddddddd', 'GA': '+241 ddddddddd', 'GE': '+995 ddddddddd', - 'DE': '+49 ddddddddd', + 'DE': '+49 dddddddddd', 'GH': '+233 ddddddddd', 'GI': '+350 ddddddddd', 'GR': '+30 ddddddddd', @@ -8058,7 +8058,7 @@ var BFHPhoneFormatList = { 'QA': '+974 ddddddddd', 'RE': '+262 ddddddddd', 'RO': '+40 ddddddddd', - 'RU': '+7 ddddddddd', + 'RU': '+7 dddddddddd', 'RW': '+250 ddddddddd', 'ST': '+239 ddddddddd', 'SH': '+290 ddddddddd', diff --git a/js/bootstrap-formhelpers-phone.js b/js/bootstrap-formhelpers-phone.js index 7a860c9..e938592 100644 --- a/js/bootstrap-formhelpers-phone.js +++ b/js/bootstrap-formhelpers-phone.js @@ -144,6 +144,7 @@ formattedNumber = ''; number = String(number).replace(/\D/g, ''); + format = String(format); for (indexFormat = 0, indexNumber = 0; indexFormat < format.length; indexFormat = indexFormat + 1) { if (/\d/g.test(format.charAt(indexFormat))) { diff --git a/js/lang/en_US/bootstrap-formhelpers-phone.en_US.js b/js/lang/en_US/bootstrap-formhelpers-phone.en_US.js index 78a3d50..df18919 100644 --- a/js/lang/en_US/bootstrap-formhelpers-phone.en_US.js +++ b/js/lang/en_US/bootstrap-formhelpers-phone.en_US.js @@ -98,7 +98,7 @@ var BFHPhoneFormatList = { 'TF': '+262 ddddddddd', 'GA': '+241 ddddddddd', 'GE': '+995 ddddddddd', - 'DE': '+49 ddddddddd', + 'DE': '+49 dddddddddd', 'GH': '+233 ddddddddd', 'GI': '+350 ddddddddd', 'GR': '+30 ddddddddd',