@@ -6,6 +6,7 @@ __New features__:
* [#44: Rewrite entirely using Deferred](https://github.com/nghuuphuoc/bootstrapvalidator/issues/44)
* [#64: Support Danish zip code](https://github.com/nghuuphuoc/bootstrapvalidator/issues/64)
+* [#65: Support Sweden zip code](https://github.com/nghuuphuoc/bootstrapvalidator/issues/64)
* [#71: Show all errors](https://github.com/nghuuphuoc/bootstrapvalidator/issues/71)
__Fixes__:
@@ -229,6 +229,7 @@ max | n/a | The maximum length. One of ```min```, ```max``` options
| country | US | A ISO 3166 country code. Currently it supports the following countries:
| | | - US (United State)
| | | - DK (Denmark)
+| | | - SE (Sweden)
## Write new validator
@@ -838,6 +838,7 @@
* Currently it supports the following countries:
* - US (United State)
* - DK (Denmark)
+ * - SE (Sweden)
*
* @returns {Boolean}
*/
@@ -849,6 +850,8 @@
switch (options.country.toUpperCase()) {
case 'DK':
return /^(DK(-|\s)?)?\d{4}$/i.test(value);
+ case 'SE':
+ return /^(S-)?\d{3}\s?\d{2}$/i.test(value);
case 'US':
default:
return /^\d{5}([\-]\d{4})?$/.test(value);
@@ -11,6 +11,7 @@
@@ -22,6 +23,8 @@