ソースを参照

opts.separator indexing fixes - jobray

Robin Herbots 13 年 前
コミット
326d042f09
1 ファイル変更3 行追加3 行削除
  1. 3 3
      js/jquery.inputmask.date.extensions.js

+ 3 - 3
js/jquery.inputmask.date.extensions.js

@@ -67,7 +67,7 @@ Optional extensions on the jquery.inputmask base
                     validator: function(chrs, buffer, pos, strict, opts) {
                     validator: function(chrs, buffer, pos, strict, opts) {
                         var isValid = opts.regex.val1.test(chrs);
                         var isValid = opts.regex.val1.test(chrs);
                         if (!strict && !isValid) {
                         if (!strict && !isValid) {
-                            if (chrs.charAt(1) == opts.separator[opts.separator.length - 1]) {
+                            if (chrs.charAt(1) == opts.separator.charAt(opts.separator.length - 1)) {
                                 isValid = opts.regex.val1.test("0" + chrs.charAt(0));
                                 isValid = opts.regex.val1.test("0" + chrs.charAt(0));
                                 if (isValid) {
                                 if (isValid) {
                                     buffer[pos - 1] = "0";
                                     buffer[pos - 1] = "0";
@@ -98,7 +98,7 @@ Optional extensions on the jquery.inputmask base
                             var frontValue = buffer.join('').substr(0, 3);
                             var frontValue = buffer.join('').substr(0, 3);
                             var isValid = opts.regex.val2(opts.separator).test(frontValue + chrs);
                             var isValid = opts.regex.val2(opts.separator).test(frontValue + chrs);
                             if (!strict && !isValid) {
                             if (!strict && !isValid) {
-                                if (chrs.charAt(1) == opts.separator[opts.separator.length - 1]) {
+                                if (chrs.charAt(1) == opts.separator.charAt(opts.separator.length - 1)) {
                                     isValid = opts.regex.val2(opts.separator).test(frontValue + "0" + chrs.charAt(0));
                                     isValid = opts.regex.val2(opts.separator).test(frontValue + "0" + chrs.charAt(0));
                                     if (isValid) {
                                     if (isValid) {
                                         buffer[pos - 1] = "0";
                                         buffer[pos - 1] = "0";
@@ -205,7 +205,7 @@ Optional extensions on the jquery.inputmask base
                                 var frontValue = buffer.join('').substr(5, 3);
                                 var frontValue = buffer.join('').substr(5, 3);
                                 var isValid = opts.regex.val2(opts.separator).test(frontValue + chrs);
                                 var isValid = opts.regex.val2(opts.separator).test(frontValue + chrs);
                                 if (!strict && !isValid) {
                                 if (!strict && !isValid) {
-                                    if (chrs.charAt(1) == opts.separator[opts.separator.length - 1]) {
+                                    if (chrs.charAt(1) == opts.separator.charAt(opts.separator.length - 1)) {
                                         isValid = opts.regex.val2(opts.separator).test(frontValue + "0" + chrs.charAt(0));
                                         isValid = opts.regex.val2(opts.separator).test(frontValue + "0" + chrs.charAt(0));
                                         if (isValid) {
                                         if (isValid) {
                                             buffer[pos - 1] = "0";
                                             buffer[pos - 1] = "0";