{"size": 2281, "ext": "js", "max_stars_repo_path": "public/libs/inputex/src/inputex-date/inputex-date-min.js", "max_stars_repo_name": "fxaeberhard/Wallogram", "max_stars_repo_stars_event_min_datetime": "2018-11-09T20:44:10.000Z", "max_stars_repo_stars_event_max_datetime": "2018-11-09T20:44:10.000Z", "max_issues_repo_path": "public/libs/inputex/src/inputex-date/inputex-date-min.js", "max_issues_repo_name": "fxaeberhard/Wallogram", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "public/libs/inputex/src/inputex-date/inputex-date-min.js", "max_forks_repo_name": "fxaeberhard/Wallogram", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 2281.0, "max_line_length": 2281, "alphanum_fraction": 0.7281893906}
YUI.add("inputex-date",function(c){var b=c.Lang,a=c.inputEx;a.DateField=function(d){a.DateField.superclass.constructor.call(this,d)};c.extend(a.DateField,a.StringField,{setOptions:function(d){a.DateField.superclass.setOptions.call(this,d);this.options.className=d.className?d.className:"inputEx-Field inputEx-DateField";this.options.messages.invalid=d.invalidDate?d.invalidDate:a.messages.invalidDate;this.options.dateFormat=d.dateFormat||a.messages.defaultDateFormat;this.options.valueFormat=d.valueFormat},validate:function(){var n=this.el.value;var j=this.options.dateFormat.match(/[^Ymd ]/g)[0];var o=n.split(j);if(o.length!=3){return false}if(isNaN(parseInt(o[0],10))||isNaN(parseInt(o[1],10))||isNaN(parseInt(o[2],10))){return false}var i=this.options.dateFormat.split(j);var e=a.indexOf("Y",i);if(o[e].length!=4){return false}var l=parseInt(o[a.indexOf("d",i)],10);var f=parseInt(o[e],10);var h=parseInt(o[a.indexOf("m",i)],10)-1;var k=new Date(f,h,l);var g=k.getFullYear();return((k.getDate()==l)&&(k.getMonth()==h)&&(g==f))},setValue:function(g,e){if(g===""){a.DateField.superclass.setValue.call(this,"",e);return}var f="";if(g instanceof Date){f=a.DateField.formatDate(g,this.options.dateFormat)}else{if(this.options.valueFormat){var d=a.DateField.parseWithFormat(g,this.options.valueFormat);f=a.DateField.formatDate(d,this.options.dateFormat)}else{f=g}}a.DateField.superclass.setValue.call(this,f,e)},getValue:function(d){var f=a.DateField.superclass.getValue.call(this);if(f===""){return""}var e=a.DateField.parseWithFormat(f,this.options.dateFormat);if(!d&&this.options.valueFormat){return a.DateField.formatDate(e,this.options.valueFormat)}return e}});a.DateField.parseWithFormat=function(j,i){var h=i.match(/[^Ymd ]/g)[0];var f=j.split(h);var g=i.split(h);var l=parseInt(f[a.indexOf("d",g)],10);var k=parseInt(f[a.indexOf("Y",g)],10);var e=parseInt(f[a.indexOf("m",g)],10)-1;return(new Date(k,e,l))};a.DateField.formatDate=function(i,g){var h=g.replace("Y",i.getFullYear());var e=i.getMonth()+1;h=h.replace("m",((e<10)?"0":"")+e);var f=i.getDate();h=h.replace("d",((f<10)?"0":"")+f);return h};a.registerType("date",a.DateField,[{type:"select",label:"Date format",name:"dateFormat",choices:[{value:"m/d/Y"},{value:"d/m/Y"}]}])},"3.1.0",{requires:["inputex-string"]});