Skip to content

Commit

Permalink
Add documentation for methods that can return null (fixes #82)
Browse files Browse the repository at this point in the history
  • Loading branch information
gf3 committed Jun 4, 2015
1 parent 0b9b89c commit 4841224
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/moment-range.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,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 @@ -136,7 +137,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

0 comments on commit 4841224

Please sign in to comment.