| 123456789 |
- /*!
- * inputmask.date.extensions.min.js
- * 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.23
- */
- !function(e){"function"==typeof define&&define.amd?define(["./dependencyLibs/inputmask.dependencyLib","./inputmask"],e):"object"==typeof exports?module.exports=e(require("./dependencyLibs/inputmask.dependencyLib"),require("./inputmask")):e(window.dependencyLib||jQuery,window.Inputmask)}(function(e,t){var o={d:["[1-9]|[12][0-9]|3[01]",Date.prototype.setDate,"day",Date.prototype.getDate],dd:["0[1-9]|[12][0-9]|3[01]",Date.prototype.setDate,"day",function(){return i(Date.prototype.getDate.call(this),2)}],ddd:[""],dddd:[""],m:["[1-9]|1[012]",Date.prototype.setMonth,"month",function(){return Date.prototype.getMonth.call(this)+1}],mm:["0[1-9]|1[012]",Date.prototype.setMonth,"month",function(){return i(Date.prototype.getMonth.call(this)+1,2)}],mmm:[""],mmmm:[""],yy:["[0-9]{2}",Date.prototype.setFullYear,"year",function(){return i(Date.prototype.getFullYear.call(this),2)}],yyyy:["[0-9]{4}",Date.prototype.setFullYear,"year",function(){return i(Date.prototype.getFullYear.call(this),4)}],h:["[1-9]|1[0-2]",Date.prototype.setHours,"hours",Date.prototype.getHours],hh:["0[1-9]|1[0-2]",Date.prototype.setHours,"hours",function(){return i(Date.prototype.getHours.call(this),2)}],hhh:["[0-9]+",Date.prototype.setHours,"hours",Date.prototype.getHours],H:["1?[0-9]|2[0-3]",Date.prototype.setHours,"hours",Date.prototype.getHours],HH:["[01][0-9]|2[0-3]",Date.prototype.setHours,"hours",function(){return i(Date.prototype.getHours.call(this),2)}],HHH:["[0-9]+",Date.prototype.setHours,"hours",Date.prototype.getHours],M:["[1-5]?[0-9]",Date.prototype.setMinutes,"minutes",Date.prototype.getMinutes],MM:["[0-5][0-9]",Date.prototype.setMinutes,"minutes",function(){return i(Date.prototype.getMinutes.call(this),2)}],s:["[1-5]?[0-9]",Date.prototype.setSeconds,"seconds",Date.prototype.getSeconds],ss:["[0-5][0-9]",Date.prototype.setSeconds,"seconds",function(){return i(Date.prototype.getSeconds.call(this),2)}],l:["[0-9]{3}",Date.prototype.setMilliseconds,"milliseconds",function(){return i(Date.prototype.getMilliseconds.call(this),3)}],L:["[0-9]{2}",Date.prototype.setMilliseconds,"milliseconds",function(){return i(Date.prototype.getMilliseconds.call(this),2)}],t:["[ap]"],tt:["[ap]m"],T:["[AP]"],TT:["[AP]M"],Z:[""],o:[""],S:[""]},r={isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:ss",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'"};function a(e){if(!e.tokenizer){var t=[];for(var r in o)-1===t.indexOf(r[0])&&t.push(r[0]);e.tokenizer="("+t.join("+|")+")+?|.",e.tokenizer=new RegExp(e.tokenizer,"g")}return e.tokenizer}function n(e,r,n,i){for(var s,u="";s=a(n).exec(e);){if(void 0===r)if(o[s[0]])u+="("+o[s[0]][0]+")";else switch(s[0]){case"[":u+="(";break;case"]":u+=")?";break;default:u+=t.escapeRegex(s[0])}else if(o[s[0]])if(!0!==i&&o[s[0]][3])u+=o[s[0]][3].call(r.date);else o[s[0]][2]?u+=r["raw"+o[s[0]][2]]:u+=s[0];else u+=s[0]}return u}function i(e,t){for(e=String(e),t=t||2;e.length<t;)e="0"+e;return e}function s(e,t,r){var n,i,s,u,p={date:new Date(1,0,1)},d=e;function m(e,t,o){e[n]=function(e){var t;if(r.min&&r.min[n]||r.max&&r.max[n]){var o=r.min&&r.min[n]||r.max[n],a=r.max&&r.max[n]||r.min[n];for(t=e.replace(/[^0-9]/g,""),t+=(o.indexOf(t)<a.indexOf(t)?a:o).toString().substr(t.length);!new RegExp(u).test(t);)t--}else t=e.replace(/[^0-9]/g,"0");return t}(t),e["raw"+n]=t,void 0!==s&&s.call(e.date,"month"==n?parseInt(e[n])-1:e[n])}if("string"==typeof d){for(;i=a(r).exec(t);){var y=d.slice(0,i[0].length);o.hasOwnProperty(i[0])&&(u=o[i[0]][0],n=o[i[0]][2],s=o[i[0]][1],m(p,y)),d=d.slice(y.length)}return p}if(d&&"object"==typeof d&&d.hasOwnProperty("date"))return d}return t.extendAliases({datetime:{mask:function(e){return o.S=e.i18n.ordinalSuffix.join("|"),e.inputFormat=r[e.inputFormat]||e.inputFormat,e.displayFormat=r[e.displayFormat]||e.displayFormat||e.inputFormat,e.outputFormat=r[e.outputFormat]||e.outputFormat||e.inputFormat,e.placeholder=""!==e.placeholder?e.placeholder:e.inputFormat.replace(/[\[\]]/,""),e.regex=n(e.inputFormat,void 0,e),null},placeholder:"",inputFormat:"isoDateTime",displayFormat:void 0,outputFormat:void 0,min:null,max:null,i18n:{dayNames:["Mon","Tue","Wed","Thu","Fri","Sat","Sun","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],monthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec","January","February","March","April","May","June","July","August","September","October","November","December"],ordinalSuffix:["st","nd","rd","th"]},postValidation:function(e,t,o,r){r.min=s(r.min,r.inputFormat,r),r.max=s(r.max,r.inputFormat,r);var a,i,u=o,p=s(e.join(""),r.inputFormat,r);return u&&p.date.getTime()==p.date.getTime()&&(a=p,i=u,u=(u=(!isFinite(a.rawday)||"29"==a.day&&!isFinite(a.rawyear)||new Date(a.date.getFullYear(),isFinite(a.rawmonth)?a.month:a.date.getMonth()+1,0).getDate()>=a.day)&&i)&&function(e,t){var o=!0;if(t.min){if(e.rawyear){var r=e.rawyear.replace(/[^0-9]/g,"");o=t.min.year.substr(0,r.length)<=r}e.year===e.rawyear&&t.min.date.getTime()==t.min.date.getTime()&&(o=t.min.date.getTime()<=e.date.getTime())}return o&&t.max&&t.max.date.getTime()==t.max.date.getTime()&&(o=t.max.date.getTime()>=e.date.getTime()),o}(p,r)),t&&u&&o.pos!==t?{buffer:n(r.inputFormat,p,r),refreshFromBuffer:{start:t,end:o.pos}}:u},onKeyDown:function(o,r,n,s){if(o.ctrlKey&&o.keyCode===t.keyCode.RIGHT){for(var u,p=new Date,d="";u=a(s).exec(s.inputFormat);)"d"===u[0].charAt(0)?d+=i(p.getDate(),u[0].length):"m"===u[0].charAt(0)?d+=i(p.getMonth()+1,u[0].length):"yyyy"===u[0]?d+=p.getFullYear().toString():"y"===u[0].charAt(0)&&(d+=i(p.getYear(),u[0].length));this.inputmask._valueSet(d),e(this).trigger("setvalue")}},onUnMask:function(e,t,o){return n(o.outputFormat,s(e,o.inputFormat,o),o,!0)},casing:function(e,t,o,r){return 0==t.nativeDef.indexOf("[ap]")?e.toLowerCase():0==t.nativeDef.indexOf("[AP]")?e.toUpperCase():e},insertMode:!1}}),t});
|