datatype-min.js revision b9436848b51ee2b4f04b9217e74172c5a05ce276
YUI.add("datatype-number",function(C){var A=C.Lang,B={toString:function(){return"DataType.Number";},parse:function(E){var D=(E===null)?E:+E;if(A.isNumber(D)){return D;}else{return null;}},format:function(J,F){J=A.isNumber(J)?J:B.parse(J);if(A.isNumber(J)){F=F||{};var E=(J<0),G=J+"",N=F.decimalPlaces,D=F.decimalSeparator||".",M=F.thousandsSeparator,L,H,K,I;if(A.isNumber(N)){G=J.toFixed(N);}if(D!=="."){G=G.replace(".",D);}if(M){L=G.lastIndexOf(D);L=(L>-1)?L:G.length;H=G.substring(L);for(K=0,I=L;I>0;I--){if((K%3===0)&&(I!==L)&&(!E||(I>1))){H=M+H;}H=G.charAt(I-1)+H;K++;}G=H;}G=(F.prefix)?F.prefix+G:G;G=(F.suffix)?G+F.suffix:G;return G;}else{return J;}}};C.namespace("DataType").Number=B;C.namespace("Parsers").number=B.parse;},"@VERSION@",{requires:["??"]});YUI.add("datatype-date",function(D){var A=function(E,G,F){if(typeof F==="undefined"){F=10;}G=G.toString();for(;parseInt(E,10)<F&&F>1;F/=10){E=G+E;}return E.toString();};D.config.dateFormat=D.config.dateFormat||"%Y-%m-%d";D.config.locale=D.config.locale||"en";var C={formats:{a:function(F,E){return E.a[F.getDay()];},A:function(F,E){return E.A[F.getDay()];},b:function(F,E){return E.b[F.getMonth()];},B:function(F,E){return E.B[F.getMonth()];},C:function(E){return A(parseInt(E.getFullYear()/100,10),0);},d:["getDate","0"],e:["getDate"," "],g:function(E){return A(parseInt(C.formats.G(E)%100,10),0);},G:function(G){var H=G.getFullYear();var F=parseInt(C.formats.V(G),10);var E=parseInt(C.formats.W(G),10);if(E>F){H++;}else{if(E===0&&F>=52){H--;}}return H;},H:["getHours","0"],I:function(F){var E=F.getHours()%12;return A(E===0?12:E,0);},j:function(I){var H=new Date(""+I.getFullYear()+"/1/1 GMT");var F=new Date(""+I.getFullYear()+"/"+(I.getMonth()+1)+"/"+I.getDate()+" GMT");var E=F-H;var G=parseInt(E/60000/60/24,10)+1;return A(G,0,100);},k:["getHours"," "],l:function(F){var E=F.getHours()%12;return A(E===0?12:E," ");},m:function(E){return A(E.getMonth()+1,0);},M:["getMinutes","0"],p:function(F,E){return E.p[F.getHours()>=12?1:0];},P:function(F,E){return E.P[F.getHours()>=12?1:0];},s:function(F,E){return parseInt(F.getTime()/1000,10);},S:["getSeconds","0"],u:function(E){var F=E.getDay();return F===0?7:F;},U:function(H){var E=parseInt(C.formats.j(H),10);var G=6-H.getDay();var F=parseInt((E+G)/7,10);return A(F,0);},V:function(H){var G=parseInt(C.formats.W(H),10);var E=(new Date(""+H.getFullYear()+"/1/1")).getDay();var F=G+(E>4||E<=1?0:1);if(F===53&&(new Date(""+H.getFullYear()+"/12/31")).getDay()<4){F=1;}else{if(F===0){F=C.formats.V(new Date(""+(H.getFullYear()-1)+"/12/31"));}}return A(F,0);},w:"getDay",W:function(H){var E=parseInt(C.formats.j(H),10);var G=7-C.formats.u(H);var F=parseInt((E+G)/7,10);return A(F,0,10);},y:function(E){return A(E.getFullYear()%100,0);},Y:"getFullYear",z:function(G){var F=G.getTimezoneOffset();var E=A(parseInt(Math.abs(F/60),10),0);var I=A(Math.abs(F%60),0);return(F>0?"-":"+")+E+I;},Z:function(E){var F=E.toString().replace(/^.*:\d\d( GMT[+-]\d+)? \(?([A-Za-z ]+)\)?\d*$/,"$2").replace(/[a-z ]/g,"");if(F.length>4){F=C.formats.z(E);}return F;},"%":function(E){return"%";}},aggregates:{c:"locale",D:"%m/%d/%y",F:"%Y-%m-%d",h:"%b",n:"\n",r:"locale",R:"%H:%M",t:"\t",T:"%H:%M:%S",x:"locale",X:"locale"},format:function(M,H){H=H||{};if(!D.Lang.isDate(M)){return D.Lang.isValue(M)?M:"";}var L=H.format||D.config.dateFormat,F=H.locale||D.config.locale;F=F.replace(/_/g,"-");if(!C.Locale[F]){var G=F.replace(/-[a-zA-Z]+$/,"");if(G in C.Locale){F=G;}else{if(D.config.locale in C.Locale){F=D.config.locale;}else{F="en";}}}var J=C.Locale[F];var I=function(O,N){var P=C.aggregates[N];return(P==="locale"?J[N]:P);};var E=function(O,N){var P=C.formats[N];switch(D.Lang.type(P)){case"string":return M[P]();case"function":return P.call(M,M,J);case"array":if(D.Lang.type(P[0])==="string"){return A(M[P[0]](),P[1]);}default:return N;}};while(L.match(/%[cDFhnrRtTxX]/)){L=L.replace(/%([cDFhnrRtTxX])/g,I);}var K=L.replace(/%([aAbBCdegGHIjklmMpPsSuUVwWyYzZ%])/g,E);I=E=undefined;return K;}};D.namespace("DataType").Date=C;var B={a:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],A:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],b:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],B:["January","February","March","April","May","June","July","August","September","October","November","December"],c:"%a %d %b %Y %T %Z",p:["AM","PM"],P:["am","pm"],r:"%I:%M:%S %p",x:"%d/%m/%y",X:"%T"};D.namespace("DataType.Date.Locale");D.DataType.Date.Locale["en"]=B;D.DataType.Date.Locale["en-US"]=D.merge(B,{c:"%a %d %b %Y %I:%M:%S %p %Z",x:"%m/%d/%Y",X:"%I:%M:%S %p"});D.DataType.Date.Locale["en-GB"]=D.merge(B,{r:"%l:%M:%S %P %Z"});D.DataType.Date.Locale["en-AU"]=D.merge(B);},"@VERSION@");YUI.add("datatype-xml",function(C){var B=C.Lang,A={toString:function(){return"DataType.XML";},parse:function(E){var D=null;if(B.isString(E)){try{if(!B.isUndefined(DOMParser)){D=new DOMParser().parseFromString(E,"text/xml");}}catch(F){try{if(!B.isUndefined(ActiveXObject)){D=new ActiveXObject("Microsoft.XMLDOM");D.async=false;D.loadXML(E);}}catch(F){}}}return D;}};C.namespace("DataType").XML=A;C.namespace("Parsers").xml=A.parse;},"@VERSION@",{requires:["??"]});YUI.add("datatype",function(A){},"@VERSION@",{use:["datatype-number","datatype-date","datatype-xml"]});