|
|
|
|
Type.registerNamespace("AjaxControlToolkit");AjaxControlToolkit.TimeSpan=function(){var a=this;if(arguments.length==0)a._ctor$0.apply(a,arguments);else if(arguments.length==1)a._ctor$1.apply(a,arguments);else if(arguments.length==3)a._ctor$2.apply(a,arguments);else if(arguments.length==4)a._ctor$3.apply(a,arguments);else if(arguments.length==5)a._ctor$4.apply(a,arguments);else throw Error.parameterCount();};AjaxControlToolkit.TimeSpan.prototype={"_ctor$0":function(){this._ticks=0},"_ctor$1":function(a){this._ctor$0();this._ticks=a},"_ctor$2":function(c,a,b){this._ctor$0();this._ticks=c*AjaxControlToolkit.TimeSpan.TicksPerHour+a*AjaxControlToolkit.TimeSpan.TicksPerMinute+b*AjaxControlToolkit.TimeSpan.TicksPerSecond},"_ctor$3":function(d,c,a,b){this._ctor$0();this._ticks=d*AjaxControlToolkit.TimeSpan.TicksPerDay+c*AjaxControlToolkit.TimeSpan.TicksPerHour+a*AjaxControlToolkit.TimeSpan.TicksPerMinute+b*AjaxControlToolkit.TimeSpan.TicksPerSecond},"_ctor$4":function(e,d,b,c,a){this._ctor$0();this._ticks=e*AjaxControlToolkit.TimeSpan.TicksPerDay+d*AjaxControlToolkit.TimeSpan.TicksPerHour+b*AjaxControlToolkit.TimeSpan.TicksPerMinute+c*AjaxControlToolkit.TimeSpan.TicksPerSecond+a*AjaxControlToolkit.TimeSpan.TicksPerMillisecond},getDays:function(){return Math.floor(this._ticks/AjaxControlToolkit.TimeSpan.TicksPerDay)},getHours:function(){return Math.floor(this._ticks/AjaxControlToolkit.TimeSpan.TicksPerHour)%24},getMinutes:function(){return Math.floor(this._ticks/AjaxControlToolkit.TimeSpan.TicksPerMinute)%60},getSeconds:function(){return Math.floor(this._ticks/AjaxControlToolkit.TimeSpan.TicksPerSecond)%60},getMilliseconds:function(){return Math.floor(this._ticks/AjaxControlToolkit.TimeSpan.TicksPerMillisecond)%1e3},getDuration:function(){return new AjaxControlToolkit.TimeSpan(Math.abs(this._ticks))},getTicks:function(){return this._ticks},getTotalDays:function(){Math.floor(this._ticks/AjaxControlToolkit.TimeSpan.TicksPerDay)},getTotalHours:function(){return Math.floor(this._ticks/AjaxControlToolkit.TimeSpan.TicksPerHour)},getTotalMinutes:function(){return Math.floor(this._ticks/AjaxControlToolkit.TimeSpan.TicksPerMinute)},getTotalSeconds:function(){return Math.floor(this._ticks/AjaxControlToolkit.TimeSpan.TicksPerSecond)},getTotalMilliseconds:function(){return Math.floor(this._ticks/AjaxControlToolkit.TimeSpan.TicksPerMillisecond)},add:function(a){return new AjaxControlToolkit.TimeSpan(this._ticks+a.getTicks())},subtract:function(a){return new AjaxControlToolkit.TimeSpan(this._ticks-a.getTicks())},negate:function(){return new AjaxControlToolkit.TimeSpan(-this._ticks)},equals:function(a){return this._ticks==a.getTicks()},compareTo:function(a){if(this._ticks>a.getTicks())return 1;else if(this._ticks<a.getTicks())return -1;else return 0},toString:function(){return this.format("F")},format:function(a){if(!a)a="F";if(a.length==1)switch(a){case "t":a=AjaxControlToolkit.TimeSpan.ShortTimeSpanPattern;break;case "T":a=AjaxControlToolkit.TimeSpan.LongTimeSpanPattern;break;case "F":a=AjaxControlToolkit.TimeSpan.FullTimeSpanPattern;break;default:throw Error.createError(String.format(AjaxControlToolkit.Resources.Common_DateTime_InvalidTimeSpan,a));}var e=/dd|d|hh|h|mm|m|ss|s|nnnn|nnn|nn|n/g,c=new Sys.StringBuilder,d=this._ticks;if(d<0){c.append("-");d=-d}for(;true;){var f=e.lastIndex,b=e.exec(a);c.append(a.slice(f,b?b.index:a.length));if(!b)break;switch(b[0]){case "dd":case "d":c.append($common.padLeft(Math.floor(d/AjaxControlToolkit.TimeSpan.TicksPerDay,b[0].length,"0")));break;case "hh":case "h":c.append($common.padLeft(Math.floor(d/AjaxControlToolkit.TimeSpan.TicksPerHour)%24,b[0].length,"0"));break;case "mm":case "m":c.append($common.padLeft(Math.floor(d/AjaxControlToolkit.TimeSpan.TicksPerMinute)%60,b[0].length,"0"));break;case "ss":case "s":c.append($common.padLeft(Math.floor(d/AjaxControlToolkit.TimeSpan.TicksPerSecond)%60,b[0].length,"0"));break;case "nnnn":case "nnn":case "nn":case "n":c.append($common.padRight(Math.floor(d/AjaxControlToolkit.TimeSpan.TicksPerMillisecond)%1e3,b[0].length,"0",true));break;default:Sys.Debug.assert
|