Skip to content

Commit

Permalink
replace function with schema key
Browse files Browse the repository at this point in the history
  • Loading branch information
saxaathlete committed Mar 14, 2019
1 parent 218a5ae commit 1b63c41
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/relative-range.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ const rangeSchema = {
minimumStart: {
type: Date,
},
_isARelativeRangeObject: {
type: Boolean,
default: true,
},
};

type RangeSchemaType = {
Expand Down Expand Up @@ -384,10 +388,6 @@ class RelativeRange {
toArray(format?: string = DAY_FORMAT): string[] {
return [this.start.format(format), this.end.format(format)];
}

isARelativeRangeObject(): boolean {
return true;
}
}

Object.keys(rangeSchema).forEach((attr) => {
Expand Down
2 changes: 1 addition & 1 deletion tests/relative-range.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe('RelativeRange', function () {
});

it('should be a relative range object', function () {
expect(this.range.isARelativeRangeObject()).to.equal(true);
expect(this.range._isARelativeRangeObject).to.equal(true);
});

describe('defaults', function () {
Expand Down

0 comments on commit 1b63c41

Please sign in to comment.