浏览代码

#374: Add Singapore postal code, thanks to @thisisclement

phuoc 11 年之前
父节点
当前提交
50412adc35
共有 4 个文件被更改,包括 6 次插入2 次删除
  1. 1 0
      CHANGELOG.md
  2. 1 0
      README.md
  3. 2 0
      dist/js/bootstrapValidator.js
  4. 2 2
      dist/js/bootstrapValidator.min.js

+ 1 - 0
CHANGELOG.md

@@ -19,6 +19,7 @@ __New Features__
 * [#324](https://github.com/nghuuphuoc/bootstrapvalidator/issues/324): Add ```success.validator.bv``` and ```error.validator.bv``` events triggered after a validator completes
 * [#332](https://github.com/nghuuphuoc/bootstrapvalidator/pull/332): Add UK phone number support for the [```phone``` validator](http://bootstrapvalidator.com/validators/phone/), thanks to [@aca02djr](https://github.com/aca02djr)
 * [#336](https://github.com/nghuuphuoc/bootstrapvalidator/issues/336): Add ```$field``` instance to the [callback validator](http://bootstrapvalidator.com/validators/callback/)
+* [#374](https://github.com/nghuuphuoc/bootstrapvalidator/pull/374): Add Singapore postal code to the [zipCode validator](http://bootstrapvalidator.com/validators/zipCode/), thanks to [@thisisclement](https://github.com/thisisclement)
 
 __Changes__
 * [#42](https://github.com/nghuuphuoc/bootstrapvalidator/issues/42): Remove the submit button from ```submitHandler()```. You can use new ```getSubmitButton()``` method to get the clicked submit button

+ 1 - 0
README.md

@@ -121,6 +121,7 @@ Big thanks to the contributors:
 * [@narutosanjiv](https://github.com/narutosanjiv)
 * [@patmoore](https://github.com/patmoore)
 * [@smeagol74](https://github.com/smeagol74)
+* [@thisisclement](https://github.com/thisisclement)
 * [@tiagofontella](https://github.com/tiagofontella)
 * [@tomByrer](https://github.com/tomByrer)
 * [@vaz](https://github.com/vaz)

+ 2 - 0
dist/js/bootstrapValidator.js

@@ -5401,6 +5401,7 @@
          * - IT (Italy)
          * - NL (Netherlands)
          * - SE (Sweden)
+         * - SG (Singapore)
          * @returns {Boolean}
          */
         validate: function(validator, $field, options) {
@@ -5422,6 +5423,7 @@
                 case 'NL': return /^[1-9][0-9]{3} ?(?!sa|sd|ss)[a-z]{2}$/i.test(value);
 
                 case 'SE': return /^(S-)?\d{3}\s?\d{2}$/i.test(value);
+                case 'SG': return /^([0][1-9]|[1-6][0-9]|[7]([0-3]|[5-9])|[8][0-2])(\d{4})$/i.test(value);
                 case 'US':
                 default: return /^\d{4,5}([\-]\d{4})?$/.test(value);
             }

文件差异内容过多而无法显示
+ 2 - 2
dist/js/bootstrapValidator.min.js