浏览代码

add mm/yyyy alias

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

+ 1 - 1
build.properties

@@ -7,7 +7,7 @@ distdir = dist
 
 build.major = 2
 build.minor = 3
-build.revision = 49
+build.revision = 50
 
 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.3.49",
+    "version": "2.3.50",
     "main": "./dist/jquery.inputmask.bundle.js",
     "dependencies": {
         "jquery": ">=1.5"

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


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


+ 13 - 6
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.3.49
+* Version: 2.3.50
 */
 
 (function ($) {
@@ -1679,7 +1679,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.3.49
+Version: 2.3.50
 
 Optional extensions on the jquery.inputmask base
 */
@@ -1781,7 +1781,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.3.49
+Version: 2.3.50
 
 Optional extensions on the jquery.inputmask base
 */
@@ -2250,6 +2250,13 @@ Optional extensions on the jquery.inputmask base
         },
         'date': {
             alias: "dd/mm/yyyy" // "mm/dd/yyyy"
+        },
+        'mm/yyyy': {
+            mask: "1/y",
+            placeholder: "mm/yyyy",
+            leapday: "donotuse",
+            separator: '/',
+            alias: "mm/dd/yyyy"
         }
     });
 })(jQuery);
@@ -2258,7 +2265,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.3.49
+Version: 2.3.50
 
 Optional extensions on the jquery.inputmask base
 */
@@ -2427,7 +2434,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.3.49
+Version: 2.3.50
 
 Regex extensions on the jquery.inputmask base
 Allows for using regular expressions as a mask
@@ -2597,7 +2604,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.3.49
+Version: 2.3.50
 
 Phone extension based on https://github.com/andr-04/inputmask-multi
 When using this extension make sure you specify the correct url to get the masks

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


文件差异内容过多而无法显示
+ 9 - 9
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.3.49",
+    "version": "2.3.50",
     "author": {
         "name": "Robin Herbots",
         "url": "http://github.com/RobinHerbots/jquery.inputmask"

+ 7 - 0
js/jquery.inputmask.date.extensions.js

@@ -472,6 +472,13 @@ Optional extensions on the jquery.inputmask base
         },
         'date': {
             alias: "dd/mm/yyyy" // "mm/dd/yyyy"
+        },
+        'mm/yyyy': {
+            mask: "1/y",
+            placeholder: "mm/yyyy",
+            leapday: "donotuse",
+            separator: '/',
+            alias: "mm/dd/yyyy"
         }
     });
 })(jQuery);

+ 10 - 0
qunit/tests.js

@@ -789,6 +789,16 @@ test("inputmask(\"hh:mm\") - add remove add", function () {
     $("#testmask").remove();
 });
 
+test("inputmask(\"mm/yyyy\") - input 31973", function () {
+    $('body').append('<input type="text" id="testmask" />');
+    $("#testmask").inputmask("mm/yyyy");
+
+    $("#testmask")[0].focus();
+    $("#testmask").Type("31973");
+    equal($("#testmask").val(), "03/1973", "Result " + $("#testmask").val());
+    $("#testmask").remove();
+});
+
 module("Numeric.Extensions");
 test("inputmask(\"decimal\", { autoGroup: true, groupSeparator: \",\" }\") - input 12345.123", function () {
     $('body').append('<input type="text" id="testmask" />');