Skip to content

Latest commit

 

History

History
24 lines (16 loc) · 402 Bytes

README.md

File metadata and controls

24 lines (16 loc) · 402 Bytes

is-valid-date-object

Returns true when passed a Date object with a value other than 'Invalid Date'. Returns false otherwise.

Install

$ npm install is-valid-date-object --save

Usage

const IsValidDate = require('is-valid-date-object');

IsValidDate( new Date() );
// true

IsValidDate( new Date('not a date string') );
// false

IsValidDate('13 December 2001');
// false