Skip to content

Commit

Permalink
datetime unmasking final RobinHerbots#1914
Browse files Browse the repository at this point in the history
  • Loading branch information
RobinHerbots committed Jul 20, 2018
1 parent f5ad595 commit 69092db
Show file tree
Hide file tree
Showing 47 changed files with 64 additions and 64 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "inputmask",
"version": "4.0.1-beta.22",
"version": "4.0.1-beta.23",
"main": [
"./index.js",
"./css/inputmask.css"
Expand Down
2 changes: 1 addition & 1 deletion component.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "inputmask",
"repository": "robinherbots/Inputmask",
"description": "Inputmask is a javascript library which creates an input mask. Inputmask can run against vanilla javascript, jQuery and jqlite.",
"version": "4.0.1-beta.22",
"version": "4.0.1-beta.23",
"keywords": [
"jquery",
"plugins",
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "robinherbots/inputmask",
"description": "Inputmask is a javascript library which creates an input mask. Inputmask can run against vanilla javascript, jQuery and jqlite.",
"version": "4.0.1-beta.22",
"version": "4.0.1-beta.23",
"type": "library",
"keywords": ["jquery", "plugins", "input", "form", "inputmask", "mask"],
"homepage": "http://robinherbots.github.io/Inputmask",
Expand Down
2 changes: 1 addition & 1 deletion dist/inputmask/bindings/inputmask.binding.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* https://github.com/RobinHerbots/Inputmask
* Copyright (c) 2010 - 2018 Robin Herbots
* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
* Version: 4.0.1-beta.22
* Version: 4.0.1-beta.23
*/

!function(factory) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* https://github.com/RobinHerbots/Inputmask
* Copyright (c) 2010 - 2018 Robin Herbots
* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
* Version: 4.0.1-beta.22
* Version: 4.0.1-beta.23
*/

!function(factory) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* https://github.com/RobinHerbots/Inputmask
* Copyright (c) 2010 - 2018 Robin Herbots
* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
* Version: 4.0.1-beta.22
* Version: 4.0.1-beta.23
*/

!function(factory) {
Expand Down
2 changes: 1 addition & 1 deletion dist/inputmask/dependencyLibs/inputmask.dependencyLib.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* https://github.com/RobinHerbots/Inputmask
* Copyright (c) 2010 - 2018 Robin Herbots
* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
* Version: 4.0.1-beta.22
* Version: 4.0.1-beta.23
*/

!function(factory) {
Expand Down
2 changes: 1 addition & 1 deletion dist/inputmask/global/document.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* https://github.com/RobinHerbots/Inputmask
* Copyright (c) 2010 - 2018 Robin Herbots
* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
* Version: 4.0.1-beta.22
* Version: 4.0.1-beta.23
*/

"function" == typeof define && define.amd ? define(function() {
Expand Down
2 changes: 1 addition & 1 deletion dist/inputmask/global/window.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* https://github.com/RobinHerbots/Inputmask
* Copyright (c) 2010 - 2018 Robin Herbots
* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
* Version: 4.0.1-beta.22
* Version: 4.0.1-beta.23
*/

"function" == typeof define && define.amd ? define(function() {
Expand Down
8 changes: 4 additions & 4 deletions dist/inputmask/inputmask.date.extensions.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* https://github.com/RobinHerbots/Inputmask
* Copyright (c) 2010 - 2018 Robin Herbots
* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
* Version: 4.0.1-beta.22
* Version: 4.0.1-beta.23
*/

!function(factory) {
Expand Down Expand Up @@ -75,7 +75,7 @@
}
return opts.tokenizer;
}
function parse(format, dateObjValue, opts) {
function parse(format, dateObjValue, opts, raw) {
for (var match, mask = ""; match = getTokenizer(opts).exec(format); ) {
if (void 0 === dateObjValue) if (formatCode[match[0]]) mask += "(" + formatCode[match[0]][0] + ")"; else switch (match[0]) {
case "[":
Expand All @@ -88,7 +88,7 @@

default:
mask += Inputmask.escapeRegex(match[0]);
} else if (formatCode[match[0]] && formatCode[match[0]][3]) mask += formatCode[match[0]][3].call(dateObjValue.date); else mask += match[0];
} else if (formatCode[match[0]]) if (!0 !== raw && formatCode[match[0]][3]) mask += formatCode[match[0]][3].call(dateObjValue.date); else formatCode[match[0]][2] ? mask += dateObjValue["raw" + formatCode[match[0]][2]] : mask += match[0]; else mask += match[0];
}
return mask;
}
Expand Down Expand Up @@ -174,7 +174,7 @@
}
},
onUnMask: function(maskedValue, unmaskedValue, opts) {
return this.isComplete(maskedValue) ? parse(opts.outputFormat, analyseMask(maskedValue, opts.inputFormat, opts), opts) : maskedValue;
return parse(opts.outputFormat, analyseMask(maskedValue, opts.inputFormat, opts), opts, !0);
},
casing: function(elem, test, pos, validPositions) {
return 0 == test.nativeDef.indexOf("[ap]") ? elem.toLowerCase() : 0 == test.nativeDef.indexOf("[AP]") ? elem.toUpperCase() : elem;
Expand Down
2 changes: 1 addition & 1 deletion dist/inputmask/inputmask.extensions.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* https://github.com/RobinHerbots/Inputmask
* Copyright (c) 2010 - 2018 Robin Herbots
* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
* Version: 4.0.1-beta.22
* Version: 4.0.1-beta.23
*/

!function(factory) {
Expand Down
2 changes: 1 addition & 1 deletion dist/inputmask/inputmask.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* https://github.com/RobinHerbots/Inputmask
* Copyright (c) 2010 - 2018 Robin Herbots
* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
* Version: 4.0.1-beta.22
* Version: 4.0.1-beta.23
*/

!function(factory) {
Expand Down
2 changes: 1 addition & 1 deletion dist/inputmask/inputmask.numeric.extensions.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* https://github.com/RobinHerbots/Inputmask
* Copyright (c) 2010 - 2018 Robin Herbots
* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
* Version: 4.0.1-beta.22
* Version: 4.0.1-beta.23
*/

!function(factory) {
Expand Down
2 changes: 1 addition & 1 deletion dist/inputmask/inputmask.phone.extensions.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* https://github.com/RobinHerbots/Inputmask
* Copyright (c) 2010 - 2018 Robin Herbots
* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
* Version: 4.0.1-beta.22
* Version: 4.0.1-beta.23
*/

!function(factory) {
Expand Down
2 changes: 1 addition & 1 deletion dist/inputmask/jquery.inputmask.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* https://github.com/RobinHerbots/Inputmask
* Copyright (c) 2010 - 2018 Robin Herbots
* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
* Version: 4.0.1-beta.22
* Version: 4.0.1-beta.23
*/

!function(factory) {
Expand Down
2 changes: 1 addition & 1 deletion dist/inputmask/phone-codes/phone-be.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* https://github.com/RobinHerbots/Inputmask
* Copyright (c) 2010 - 2018 Robin Herbots
* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
* Version: 4.0.1-beta.22
* Version: 4.0.1-beta.23
*/

!function(factory) {
Expand Down
2 changes: 1 addition & 1 deletion dist/inputmask/phone-codes/phone-ca.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* https://github.com/RobinHerbots/Inputmask
* Copyright (c) 2010 - 2018 Robin Herbots
* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
* Version: 4.0.1-beta.22
* Version: 4.0.1-beta.23
*/

!function(factory) {
Expand Down
2 changes: 1 addition & 1 deletion dist/inputmask/phone-codes/phone-hu.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* https://github.com/RobinHerbots/Inputmask
* Copyright (c) 2010 - 2018 Robin Herbots
* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
* Version: 4.0.1-beta.22
* Version: 4.0.1-beta.23
*/

!function(factory) {
Expand Down
2 changes: 1 addition & 1 deletion dist/inputmask/phone-codes/phone-it.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* https://github.com/RobinHerbots/Inputmask
* Copyright (c) 2010 - 2018 Robin Herbots
* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
* Version: 4.0.1-beta.22
* Version: 4.0.1-beta.23
*/

!function(factory) {
Expand Down
2 changes: 1 addition & 1 deletion dist/inputmask/phone-codes/phone-mx.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* https://github.com/RobinHerbots/Inputmask
* Copyright (c) 2010 - 2018 Robin Herbots
* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
* Version: 4.0.1-beta.22
* Version: 4.0.1-beta.23
*/

!function(factory) {
Expand Down
2 changes: 1 addition & 1 deletion dist/inputmask/phone-codes/phone-nl.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* https://github.com/RobinHerbots/Inputmask
* Copyright (c) 2010 - 2018 Robin Herbots
* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
* Version: 4.0.1-beta.22
* Version: 4.0.1-beta.23
*/

!function(factory) {
Expand Down
2 changes: 1 addition & 1 deletion dist/inputmask/phone-codes/phone-ru.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* https://github.com/RobinHerbots/Inputmask
* Copyright (c) 2010 - 2018 Robin Herbots
* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
* Version: 4.0.1-beta.22
* Version: 4.0.1-beta.23
*/

!function(factory) {
Expand Down
2 changes: 1 addition & 1 deletion dist/inputmask/phone-codes/phone.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* https://github.com/RobinHerbots/Inputmask
* Copyright (c) 2010 - 2018 Robin Herbots
* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
* Version: 4.0.1-beta.22
* Version: 4.0.1-beta.23
*/

!function(factory) {
Expand Down
10 changes: 5 additions & 5 deletions dist/jquery.inputmask.bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* https://github.com/RobinHerbots/Inputmask
* Copyright (c) 2010 - 2018 Robin Herbots
* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
* Version: 4.0.1-beta.22
* Version: 4.0.1-beta.23
*/

!function(modules) {
Expand Down Expand Up @@ -135,7 +135,7 @@
}
return opts.tokenizer;
}
function parse(format, dateObjValue, opts) {
function parse(format, dateObjValue, opts, raw) {
for (var match, mask = ""; match = getTokenizer(opts).exec(format); ) if (void 0 === dateObjValue) if (formatCode[match[0]]) mask += "(" + formatCode[match[0]][0] + ")"; else switch (match[0]) {
case "[":
mask += "(";
Expand All @@ -147,10 +147,10 @@

default:
mask += Inputmask.escapeRegex(match[0]);
} else if (formatCode[match[0]] && formatCode[match[0]][3]) {
} else if (formatCode[match[0]]) if (!0 !== raw && formatCode[match[0]][3]) {
var getFn = formatCode[match[0]][3];
mask += getFn.call(dateObjValue.date);
} else mask += match[0];
} else formatCode[match[0]][2] ? mask += dateObjValue["raw" + formatCode[match[0]][2]] : mask += match[0]; else mask += match[0];
return mask;
}
function pad(val, len) {
Expand Down Expand Up @@ -235,7 +235,7 @@
}
},
onUnMask: function(maskedValue, unmaskedValue, opts) {
return this.isComplete(maskedValue) ? parse(opts.outputFormat, analyseMask(maskedValue, opts.inputFormat, opts), opts) : maskedValue;
return parse(opts.outputFormat, analyseMask(maskedValue, opts.inputFormat, opts), opts, !0);
},
casing: function(elem, test, pos, validPositions) {
return 0 == test.nativeDef.indexOf("[ap]") ? elem.toLowerCase() : 0 == test.nativeDef.indexOf("[AP]") ? elem.toUpperCase() : elem;
Expand Down
2 changes: 1 addition & 1 deletion dist/min/inputmask/bindings/inputmask.binding.min.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* https://github.com/RobinHerbots/Inputmask
* Copyright (c) 2010 - 2018 Robin Herbots
* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
* Version: 4.0.1-beta.22
* Version: 4.0.1-beta.23
*/

!function(a){"function"==typeof define&&define.amd?define(["jquery","../inputmask","../global/document"],a):"object"==typeof exports?module.exports=a(require("jquery"),require("../inputmask"),require("../global/document")):a(jQuery,window.Inputmask,document)}(function(a,t,n){a(n).ajaxComplete(function(n,i,e){-1!==a.inArray("html",e.dataTypes)&&a(".inputmask, [data-inputmask], [data-inputmask-mask], [data-inputmask-alias]").each(function(a,n){void 0===n.inputmask&&t().mask(n)})}).ready(function(){a(".inputmask, [data-inputmask], [data-inputmask-mask], [data-inputmask-alias]").each(function(a,n){void 0===n.inputmask&&t().mask(n)})})});

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* https://github.com/RobinHerbots/Inputmask
* Copyright (c) 2010 - 2018 Robin Herbots
* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
* Version: 4.0.1-beta.22
* Version: 4.0.1-beta.23
*/

!function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports?module.exports=e(require("jquery")):window.dependencyLib=e(jQuery)}(function(e){return e});

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/min/inputmask/global/document.min.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* https://github.com/RobinHerbots/Inputmask
* Copyright (c) 2010 - 2018 Robin Herbots
* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
* Version: 4.0.1-beta.22
* Version: 4.0.1-beta.23
*/

"function"==typeof define&&define.amd?define(function(){return document}):"object"==typeof exports&&(module.exports=document);
2 changes: 1 addition & 1 deletion dist/min/inputmask/global/window.min.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* https://github.com/RobinHerbots/Inputmask
* Copyright (c) 2010 - 2018 Robin Herbots
* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
* Version: 4.0.1-beta.22
* Version: 4.0.1-beta.23
*/

"function"==typeof define&&define.amd?define(function(){return window}):"object"==typeof exports&&(module.exports=window);
Loading

0 comments on commit 69092db

Please sign in to comment.