diff --git a/bower.json b/bower.json index 3326058..dc7be81 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "moment-range", - "version": "2.0.3", + "version": "2.1.0", "main": "./dist/moment-range.js", "ignore": [ "**/.*", diff --git a/dist/moment-range.js b/dist/moment-range.js index ae05754..bc1cb16 100644 --- a/dist/moment-range.js +++ b/dist/moment-range.js @@ -69,8 +69,8 @@ function DateRange(start, end) { } } - this.start = moment(s); - this.end = moment(e); + this.start = (s === null) ? moment(-8640000000000000) : moment(s); + this.end = (e === null) ? moment(8640000000000000) : moment(e); } /** diff --git a/dist/moment-range.min.js b/dist/moment-range.min.js index cf83525..0b47788 100644 --- a/dist/moment-range.min.js +++ b/dist/moment-range.min.js @@ -1 +1 @@ -!function(a,b){"function"==typeof define&&define.amd?define(["moment"],function(c){return a.DateRange=b(c)}):"object"==typeof exports?module.exports=b(require("moment")):a.DateRange=b(moment)}(this,function(a){function b(b,c){var d,e=b,f=c;(1===arguments.length||void 0===c)&&("object"==typeof b&&2===b.length?(e=b[0],f=b[1]):"string"==typeof b&&(d=b.split("/"),e=d[0],f=d[1])),this.start=a(e),this.end=a(f)}function c(b,c,d){for(var e=a(this.start);this.contains(e,d);)c.call(this,e.clone()),e.add(1,b)}function d(b,c,d){var e=this/b,f=Math.floor(e);if(f!==1/0){f===e&&d&&f--;for(var g=0;f>=g;g++)c.call(this,a(this.start.valueOf()+b.valueOf()*g))}}var e={year:!0,month:!0,week:!0,day:!0,hour:!0,minute:!0,second:!0};return b.prototype.constructor=b,b.prototype.clone=function(){return a().range(this.start,this.end)},b.prototype.contains=function(a,c){var d=this.start,e=this.end;return a instanceof b?d<=a.start&&(e>a.end||e.isSame(a.end)&&!c):a>=d&&(e>a||e.isSame(a)&&!c)},b.prototype.overlaps=function(a){return null!==this.intersect(a)},b.prototype.intersect=function(a){var c=this.start,d=this.end;return c<=a.start&&a.start=c&&dc&&d<=a.end?[]:a.start<=c&&c=g;g++)c.call(this,a(this.start.valueOf()+b.valueOf()*g))}}var e={year:!0,month:!0,week:!0,day:!0,hour:!0,minute:!0,second:!0};return b.prototype.constructor=b,b.prototype.clone=function(){return a().range(this.start,this.end)},b.prototype.contains=function(a,c){var d=this.start,e=this.end;return a instanceof b?d<=a.start&&(e>a.end||e.isSame(a.end)&&!c):a>=d&&(e>a||e.isSame(a)&&!c)},b.prototype.overlaps=function(a){return null!==this.intersect(a)},b.prototype.intersect=function(a){var c=this.start,d=this.end;return c<=a.start&&a.start=c&&dc&&d<=a.end?[]:a.start<=c&&c