浏览代码

fix hh:mm t mask complete event

Robin Herbots 12 年之前
父节点
当前提交
ccae01ee7a

+ 1 - 1
build.properties

@@ -7,7 +7,7 @@ distdir = dist
 
 build.major = 2
 build.minor = 2
-build.revision = 47
+build.revision = 48
 
 target = jquery.inputmask.bundle.js
 target.min = jquery.inputmask.bundle.min.js

+ 1 - 1
component.json

@@ -1,6 +1,6 @@
 {
     "name": "jquery.inputmask",
-    "version": "2.2.47",
+    "version": "2.2.48",
     "main": "./dist/jquery.inputmask.bundle.js",
     "dependencies": {
         "jquery": ">=1.5"

二进制
dist/jQuery.InputMask.2.2.46.nupkg


二进制
dist/jQuery.InputMask.2.2.47.nupkg


二进制
dist/jQuery.InputMask.2.2.48.nupkg


+ 10 - 35
dist/jquery.inputmask.bundle.js

@@ -3,7 +3,7 @@
 * http://github.com/RobinHerbots/jquery.inputmask
 * Copyright (c) 2010 - 2013 Robin Herbots
 * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-* Version: 2.2.47
+* Version: 2.2.48
 */
 
 (function ($) {
@@ -1474,7 +1474,7 @@ Input Mask plugin extensions
 http://github.com/RobinHerbots/jquery.inputmask
 Copyright (c) 2010 - 2013 Robin Herbots
 Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-Version: 2.2.47
+Version: 2.2.48
 
 Optional extensions on the jquery.inputmask base
 */
@@ -1575,7 +1575,7 @@ Input Mask plugin extensions
 http://github.com/RobinHerbots/jquery.inputmask
 Copyright (c) 2010 - 2012 Robin Herbots
 Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-Version: 2.2.47
+Version: 2.2.48
 
 Optional extensions on the jquery.inputmask base
 */
@@ -1934,7 +1934,6 @@ Optional extensions on the jquery.inputmask base
                 hrspre: new RegExp("[012]"), //hours pre
                 hrs24: new RegExp("2[0-9]|1[3-9]"),
                 hrs: new RegExp("[01][0-9]|2[0-3]"), //hours
-                ampmpre: new RegExp("[apAP]"),
                 ampm: new RegExp("^[a|p|A|P][m|M]")
             },
             timeseparator: ':',
@@ -2000,53 +1999,29 @@ Optional extensions on the jquery.inputmask base
                 },
                 't': { //am/pm
                     validator: function (chrs, buffer, pos, strict, opts) {
-                        var isValid = opts.regex.ampm.test(chrs);
-                        if (!strict && !isValid) {
-                            isValid = opts.regex.ampm.test(chrs + 'm');
-                            if (isValid) {
-                                buffer[pos - 1] = chrs.charAt(0);
-                                buffer[pos] = "m";
-                                pos++;
-                                return pos;
-                            }
-                        }
-                        return isValid;
+                        return opts.regex.ampm.test(chrs + "m");
                     },
                     casing: "lower",
-                    cardinality: 2,
-                    prevalidator: [{
-                        validator: function (chrs, buffer, pos, strict, opts) {
-                            var isValid = opts.regex.ampmpre.test(chrs);
-                            if (isValid) {
-                                isValid = opts.regex.ampm.test(chrs + "m");
-                                if (isValid) {
-                                    buffer[pos] = chrs;
-                                    buffer[pos + 1] = 'm';
-                                    return pos;
-                                }
-                            }
-                            return isValid;
-                        }, cardinality: 1
-                    }]
+                    cardinality: 1
                 }
             },
             insertMode: false,
             autoUnmask: false
         },
         'datetime12': {
-            mask: "1/2/y h:s t",
+            mask: "1/2/y h:s t\\m",
             placeholder: "dd/mm/yyyy hh:mm xm",
             alias: "datetime",
             hourFormat: "12"
         },
         'hh:mm t': {
-            mask: "h:s t",
+            mask: "h:s t\\m",
             placeholder: "hh:mm xm",
             alias: "datetime",
             hourFormat: "12"
         },
         'h:s t': {
-            mask: "h:s t",
+            mask: "h:s t\\m",
             placeholder: "hh:mm xm",
             alias: "datetime",
             hourFormat: "12"
@@ -2068,7 +2043,7 @@ Input Mask plugin extensions
 http://github.com/RobinHerbots/jquery.inputmask
 Copyright (c) 2010 - 2013 Robin Herbots
 Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-Version: 2.2.47
+Version: 2.2.48
 
 Optional extensions on the jquery.inputmask base
 */
@@ -2230,7 +2205,7 @@ Input Mask plugin extensions
 http://github.com/RobinHerbots/jquery.inputmask
 Copyright (c) 2010 - 2013 Robin Herbots
 Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
-Version: 2.2.47
+Version: 2.2.48
 
 Regex extensions on the jquery.inputmask base
 Allows for using regular expressions as a mask

文件差异内容过多而无法显示
+ 4 - 4
dist/jquery.inputmask.bundle.min.js


文件差异内容过多而无法显示
+ 11 - 11
dist/min/jquery.inputmask.date.extensions.js


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


+ 1 - 1
jquery.inputmask.jquery.json

@@ -8,7 +8,7 @@
 		"inputmask",
 		"mask"
     ],
-    "version": "2.2.47",
+    "version": "2.2.48",
     "author": {
         "name": "Robin Herbots",
         "url": "http://github.com/RobinHerbots/jquery.inputmask"

+ 5 - 30
js/jquery.inputmask.date.extensions.js

@@ -362,7 +362,6 @@ Optional extensions on the jquery.inputmask base
                 hrspre: new RegExp("[012]"), //hours pre
                 hrs24: new RegExp("2[0-9]|1[3-9]"),
                 hrs: new RegExp("[01][0-9]|2[0-3]"), //hours
-                ampmpre: new RegExp("[apAP]"),
                 ampm: new RegExp("^[a|p|A|P][m|M]")
             },
             timeseparator: ':',
@@ -428,53 +427,29 @@ Optional extensions on the jquery.inputmask base
                 },
                 't': { //am/pm
                     validator: function (chrs, buffer, pos, strict, opts) {
-                        var isValid = opts.regex.ampm.test(chrs);
-                        if (!strict && !isValid) {
-                            isValid = opts.regex.ampm.test(chrs + 'm');
-                            if (isValid) {
-                                buffer[pos - 1] = chrs.charAt(0);
-                                buffer[pos] = "m";
-                                pos++;
-                                return pos;
-                            }
-                        }
-                        return isValid;
+                        return opts.regex.ampm.test(chrs + "m");
                     },
                     casing: "lower",
-                    cardinality: 2,
-                    prevalidator: [{
-                        validator: function (chrs, buffer, pos, strict, opts) {
-                            var isValid = opts.regex.ampmpre.test(chrs);
-                            if (isValid) {
-                                isValid = opts.regex.ampm.test(chrs + "m");
-                                if (isValid) {
-                                    buffer[pos] = chrs;
-                                    buffer[pos + 1] = 'm';
-                                    return pos;
-                                }
-                            }
-                            return isValid;
-                        }, cardinality: 1
-                    }]
+                    cardinality: 1
                 }
             },
             insertMode: false,
             autoUnmask: false
         },
         'datetime12': {
-            mask: "1/2/y h:s t",
+            mask: "1/2/y h:s t\\m",
             placeholder: "dd/mm/yyyy hh:mm xm",
             alias: "datetime",
             hourFormat: "12"
         },
         'hh:mm t': {
-            mask: "h:s t",
+            mask: "h:s t\\m",
             placeholder: "hh:mm xm",
             alias: "datetime",
             hourFormat: "12"
         },
         'h:s t': {
-            mask: "h:s t",
+            mask: "h:s t\\m",
             placeholder: "hh:mm xm",
             alias: "datetime",
             hourFormat: "12"