Skip to content

Commit

Permalink
Update datetime error message
Browse files Browse the repository at this point in the history
  • Loading branch information
mShan0 committed Nov 22, 2023
1 parent fbf3c74 commit 2349cb3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/data-types/datetime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ const DateTime: DataType = {
}

if (value < MIN_DATE || value > MAX_DATE) {
throw new TypeError('Out of range.');
throw new TypeError('Date is out of range.');
}

return value;
Expand Down
4 changes: 2 additions & 2 deletions test/unit/data-type.js
Original file line number Diff line number Diff line change
Expand Up @@ -251,13 +251,13 @@ describe('DateTime', function() {
it('returns a TypeError for dates that are below January 1, 1753', function() {
assert.throws(() => {
TYPES.DateTime.validate(new Date('January 1, 1752'));
}, TypeError, 'Out of range.');
}, TypeError, 'Date is out of range.');
});

it('returns a TypeError for dates that are greater than December 31, 9999', function() {
assert.throws(() => {
TYPES.DateTime.validate(new Date('December 31, 10000'));
}, TypeError, 'Out of range.');
}, TypeError, 'Date is out of range.');
});
});
});
Expand Down

0 comments on commit 2349cb3

Please sign in to comment.