浏览代码

Fix inclusive option in the lessThan validator, thanks to @johanronn77

nghuuphuoc 11 年之前
父节点
当前提交
ac0b83088c
共有 4 个文件被更改,包括 4 次插入3 次删除
  1. 1 0
      CHANGELOG.md
  2. 1 1
      dist/js/bootstrapValidator.js
  3. 1 1
      dist/js/bootstrapValidator.min.js
  4. 1 1
      src/js/validator/lessThan.js

+ 1 - 0
CHANGELOG.md

@@ -16,6 +16,7 @@
 * [#287](https://github.com/nghuuphuoc/bootstrapvalidator/issues/287): Only send the submit button which is clicked. It's an enhancement for [#238](https://github.com/nghuuphuoc/bootstrapvalidator/issues/238)
 * [#287](https://github.com/nghuuphuoc/bootstrapvalidator/issues/287): Only send the submit button which is clicked. It's an enhancement for [#238](https://github.com/nghuuphuoc/bootstrapvalidator/issues/238)
 * [#288](https://github.com/nghuuphuoc/bootstrapvalidator/issues/288): Fix [```date``` validator](http://bootstrapvalidator.com/validators/date/) issue on IE8
 * [#288](https://github.com/nghuuphuoc/bootstrapvalidator/issues/288): Fix [```date``` validator](http://bootstrapvalidator.com/validators/date/) issue on IE8
 * [#292](https://github.com/nghuuphuoc/bootstrapvalidator/pull/292): Fix identical validator issue with not clearing ```has-error``` class, thanks to [@alavers](https://github.com/alavers)
 * [#292](https://github.com/nghuuphuoc/bootstrapvalidator/pull/292): Fix identical validator issue with not clearing ```has-error``` class, thanks to [@alavers](https://github.com/alavers)
+* [#305](https://github.com/nghuuphuoc/bootstrapvalidator/pull/305): Fix ```inclusive``` option in the [```lessThan``` validator](http://bootstrapvalidator.com/validators/lessThan/), thanks to [@johanronn77](https://github.com/johanronn77)
 * [#259](https://github.com/nghuuphuoc/bootstrapvalidator/issues/259): Typo "Support almost Bootstrap forms"
 * [#259](https://github.com/nghuuphuoc/bootstrapvalidator/issues/259): Typo "Support almost Bootstrap forms"
 * [#261](https://github.com/nghuuphuoc/bootstrapvalidator/pull/261): English fix to 'amazing contributors' section, thanks to [@lloydde](https://github.com/lloydde)
 * [#261](https://github.com/nghuuphuoc/bootstrapvalidator/pull/261): English fix to 'amazing contributors' section, thanks to [@lloydde](https://github.com/lloydde)
 * [#278](https://github.com/nghuuphuoc/bootstrapvalidator/pull/278): Update [```choice``` validator](http://bootstrapvalidator.com/validators/choice/) document, thanks to [@MrC0mm0n](https://github.com/MrC0mm0n)
 * [#278](https://github.com/nghuuphuoc/bootstrapvalidator/pull/278): Update [```choice``` validator](http://bootstrapvalidator.com/validators/choice/) document, thanks to [@MrC0mm0n](https://github.com/MrC0mm0n)

+ 1 - 1
dist/js/bootstrapValidator.js

@@ -3376,7 +3376,7 @@
                 return true;
                 return true;
             }
             }
             value = parseFloat(value);
             value = parseFloat(value);
-            return (options.inclusive === false) ? (value <= options.value) : (value < options.value);
+            return (options.inclusive === false || options.inclusive == undefined) ? (value <= options.value) : (value < options.value);
         }
         }
     };
     };
 }(window.jQuery));
 }(window.jQuery));

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


+ 1 - 1
src/js/validator/lessThan.js

@@ -34,7 +34,7 @@
                 return true;
                 return true;
             }
             }
             value = parseFloat(value);
             value = parseFloat(value);
-            return (options.inclusive === false || options.inclusive==undefined) ? (value <= options.value) : (value < options.value);
+            return (options.inclusive === false || options.inclusive == undefined) ? (value <= options.value) : (value < options.value);
         }
         }
     };
     };
 }(window.jQuery));
 }(window.jQuery));