Browse Source

#182: Update the CHANGELOG

nghuuphuoc 11 years ago
parent
commit
efc0417e6f
3 changed files with 5 additions and 4 deletions
  1. 1 0
      CHANGELOG.md
  2. 2 2
      dist/js/bootstrapValidator.js
  3. 2 2
      dist/js/bootstrapValidator.min.js

+ 1 - 0
CHANGELOG.md

@@ -8,6 +8,7 @@
 * [#171](https://github.com/nghuuphuoc/bootstrapvalidator/pull/171): The [```phone``` validator](http://bootstrapvalidator.com/validators/phone/) now supports +1 country code and area code for US phone number, thanks to [@tomByrer](https://github.com/tomByrer)
 * [#173](https://github.com/nghuuphuoc/bootstrapvalidator/pull/173): The [```remote``` validator](http://bootstrapvalidator.com/validators/remote/) allows to override ```name``` option, thanks to [@jswale](https://github.com/jswale)
 * [#178](https://github.com/nghuuphuoc/bootstrapvalidator/pull/178): Do not validate fields that ```enabled``` is set to ```false```, thanks to [@henningda](https://github.com/henningda)
+* [#182](https://github.com/nghuuphuoc/bootstrapvalidator/pull/182): Improve [```zipCode``` validator](http://bootstrapvalidator.com/validators/zip-code/), thanks to [@gercheq](https://github.com/gercheq)
 
 ## v0.4.1 (2014-04-12)
 

+ 2 - 2
dist/js/bootstrapValidator.js

@@ -1802,7 +1802,7 @@
                     // May start with 1, +1, or 1-; should discard
                     // Area code may be delimited with (), & sections may be delimited with . or -
                     // Test: http://regexr.com/38mqi
-                    value = value.replace(/\(|\)|\s+/g, '');
+                    value = value.replace(/\D/g, '');
                     return (/^(?:(1\-?)|(\+1 ?))?\(?(\d{3})[\)\-\.]?(\d{3})[\-\.]?(\d{4})$/).test(value) && (value.length == 10);
             }
         }
@@ -2386,7 +2386,7 @@
                     return /^(S-)?\d{3}\s?\d{2}$/i.test(value);
                 case 'US':
                 default:
-                    return /^\d{5}([\-]\d{4})?$/.test(value);
+                    return /^\d{4,5}([\-]\d{4})?$/.test(value);
             }
         }
     };

File diff suppressed because it is too large
+ 2 - 2
dist/js/bootstrapValidator.min.js