is-date-object
Is this value a JS Date object? This module works cross-realm/iframe, and despite ES6 @@toStringTag.
Last updated 2 years ago by ljharb .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install is-date-object 
SYNC missed versions from official npm registry.

is-date-object Version Badge

github actions coverage dependency status dev dependency status License Downloads

npm badge

Is this value a JS Date object? This module works cross-realm/iframe, and despite ES6 @@toStringTag.

Example

var isDate = require('is-date-object');
var assert = require('assert');

assert.notOk(isDate(undefined));
assert.notOk(isDate(null));
assert.notOk(isDate(false));
assert.notOk(isDate(true));
assert.notOk(isDate(42));
assert.notOk(isDate('foo'));
assert.notOk(isDate(function () {}));
assert.notOk(isDate([]));
assert.notOk(isDate({}));
assert.notOk(isDate(/a/g));
assert.notOk(isDate(new RegExp('a', 'g')));

assert.ok(isDate(new Date()));

Tests

Simply clone the repo, npm install, and run npm test

Current Tags

  • 1.1.0                                ...           latest (2 years ago)

7 Versions

  • 1.1.0                                ...           2 years ago
  • 1.0.5                                ...           5 years ago
  • 1.0.4                                ...           6 years ago
  • 1.0.3                                ...           6 years ago
  • 1.0.2                                ...           7 years ago
  • 1.0.1                                ...           11 years ago
  • 1.0.0                                ...           12 years ago
Maintainers (1)
Downloads
Total 22
Today 0
This Week 0
This Month 9
Last Day 0
Last Week 0
Last Month 0
Dependencies (2)
Dev Dependencies (17)

© 2010 - cnpmjs.org x YWFE | Home | YWFE