(function(){"use strict";u8.Base.DateRange=function(t){if(!(this instanceof u8.Base.DateRange)){if(arguments.length>0&&!t){return t}if(u8.tools.isInstanceOfClass(t,u8.Base.DateRange)){return t}if(arguments.length==2){return new u8.Base.DateRange(arguments[0],arguments[1])}return new u8.Base.DateRange(t)}if(arguments.length==2){this.start=arguments[0];this.end=arguments[1]}else if(typeof t=="object"){$.extend(this,t)}if(this.start){this.start=this.start.clone()}if(this.end){this.end=this.end.clone()}if(!this.start&&!this.end){this.start=new Date}if(!this.start){this.start=this.end.clone()}else if(!this.end){this.end=this.start.clone()}if(this.start>this.end){var e=this.end;this.end=this.start;this.start=e}};$.extend(u8.Base.DateRange.prototype,{toDateString:function(t){return Date.getRangeString(this.start,this.end,t)},getDurationInDays:function(){return Date.diffDays(this.end,this.start)}});$.extend(u8.Base.DateRange,{equals:function(t,e){if(!t&&!e){return true}if(!t||!e){return false}if(!u8.Base._Date.equals(t.start,e.start)){return false}if(!u8.Base._Date.equals(t.end,e.end)){return false}return true}})})();