Skip to content

Commit

Permalink
Version bump to 2.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
gf3 committed Jul 17, 2015
1 parent c415d45 commit dbe0325
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 14 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "moment-range",
"version": "2.0.2",
"version": "2.0.3",
"main": "./dist/moment-range.js",
"ignore": [
"**/.*",
Expand Down
34 changes: 23 additions & 11 deletions dist/moment-range.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,20 +38,18 @@ var INTERVALS = {
/**
* DateRange class to store ranges and query dates.
*
* @class DateRange
* @constructor
* @param {(Moment|Date)} start Start of interval
* @param {(Moment|Date)} end End of interval
*/
/**
*//**
* DateRange class to store ranges and query dates.
*
* @class DateRange^1
* @constructor
* @param {!Array} range Array containing start and end dates.
*/
/**
*//**
* DateRange class to store ranges and query dates.
*
* @class DateRange^2
* @constructor
* @param {!String} range String formatted as an IS0 8601 time interval
*/
function DateRange(start, end) {
Expand All @@ -78,7 +76,7 @@ function DateRange(start, end) {
/**
* Constructor for prototype.
*
* @return {Function}
* @type {DateRange}
*/
DateRange.prototype.constructor = DateRange;

Expand Down Expand Up @@ -127,7 +125,8 @@ DateRange.prototype.overlaps = function(range) {
*
* @param {!DateRange} other A date range to intersect with this one
*
* @return {DateRange}
* @return {DateRange} Returns the intersecting date or `null` if the ranges do
* not intersect
*/
DateRange.prototype.intersect = function(other) {
var start = this.start;
Expand All @@ -154,7 +153,8 @@ DateRange.prototype.intersect = function(other) {
*
* @param {!DateRange} other A date range to add to this one
*
* @return {DateRange}
* @return {DateRange} Returns the new `DateRange` or `null` if they do not
* overlap
*/
DateRange.prototype.add = function(other) {
if (this.overlaps(other)) {
Expand Down Expand Up @@ -190,6 +190,9 @@ DateRange.prototype.subtract = function(other) {
else if ((start < other.start) && (other.start < other.end) && (other.end < end)) {
return [new DateRange(start, other.start), new DateRange(other.end, end)];
}
else if ((start < other.start) && (other.start < end) && (other.end < end)) {
return [new DateRange(start, other.start), new DateRange(other.start, end)];
}
};

/**
Expand All @@ -199,7 +202,7 @@ DateRange.prototype.subtract = function(other) {
* @param {(!DateRange|String)} range Date range to be used for iteration or
* shorthand string (shorthands:
* http://momentjs.com/docs/#/manipulating/add/)
* @param {!function(Moment)} hollaback Function to execute for each sub-range
* @param {!DateRange~by} hollaback Callback
* @param {!boolean} exclusive Indicate that the end of the range should not
* be included in the iter.
*
Expand All @@ -215,6 +218,15 @@ DateRange.prototype.by = function(range, hollaback, exclusive) {
return this;
};


/**
* Callback executed for each sub-range.
*
* @callback DateRange~by
*
* @param {!Moment} current Current moment object for iteration
*/

/**
* @private
*/
Expand Down
2 changes: 1 addition & 1 deletion dist/moment-range.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"directories": {
"lib": "./lib"
},
"version": "2.0.2",
"version": "2.0.3",
"engines": {
"node": "*"
},
Expand Down

0 comments on commit dbe0325

Please sign in to comment.