浏览代码

#288: Fix date validator issue on IE8

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

+ 1 - 0
CHANGELOG.md

@@ -9,6 +9,7 @@
 * [#211](https://github.com/nghuuphuoc/bootstrapvalidator/issues/211), [#235](https://github.com/nghuuphuoc/bootstrapvalidator/issues/235): Add new method ```getInvalidFields()``` that returns all invalid fields
 * [#275](https://github.com/nghuuphuoc/bootstrapvalidator/issues/275): Add ```destroy()``` method
 * [#274](https://github.com/nghuuphuoc/bootstrapvalidator/pull/274): Fix feedback icons in ```input-group```, thanks to [@tiagofontella](https://github.com/tiagofontella)
+* [#288](https://github.com/nghuuphuoc/bootstrapvalidator/issues/288): Fix [```date``` validator](http://bootstrapvalidator.com/validators/date/) issue on IE8
 
 ## v0.4.5 (2015-05-15)
 

+ 3 - 3
dist/js/bootstrapValidator.js

@@ -1702,9 +1702,9 @@
             // Determine the date
             date       = date.split(separator);
             dateFormat = dateFormat.split(separator);
-            var year  = date[dateFormat.indexOf('YYYY')],
-                month = date[dateFormat.indexOf('MM')],
-                day   = date[dateFormat.indexOf('DD')];
+            var year  = date[$.inArray('YYYY', dateFormat)],
+                month = date[$.inArray('MM', dateFormat)],
+                day   = date[$.inArray('DD', dateFormat)];
 
             // Determine the time
             var minutes = null, hours = null, seconds = null;

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


+ 3 - 3
src/js/validator/date.js

@@ -50,9 +50,9 @@
             // Determine the date
             date       = date.split(separator);
             dateFormat = dateFormat.split(separator);
-            var year  = date[dateFormat.indexOf('YYYY')],
-                month = date[dateFormat.indexOf('MM')],
-                day   = date[dateFormat.indexOf('DD')];
+            var year  = date[$.inArray('YYYY', dateFormat)],
+                month = date[$.inArray('MM', dateFormat)],
+                day   = date[$.inArray('DD', dateFormat)];
 
             // Determine the time
             var minutes = null, hours = null, seconds = null;