Sha256: 5342554adb21f1651e12b871be9f8d85ad851c0a07c5c3d93a80ae720fc8beb9

Contents?: true

Size: 551 Bytes

Versions: 67

Compression:

Stored size: 551 Bytes

Contents

'use strict';

var getDay = Date.prototype.getDay;
var tryDateObject = function tryDateObject(value) {
	try {
		getDay.call(value);
		return true;
	} catch (e) {
		return false;
	}
};

var toStr = Object.prototype.toString;
var dateClass = '[object Date]';
var hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol';

module.exports = function isDateObject(value) {
	if (typeof value !== 'object' || value === null) { return false; }
	return hasToStringTag ? tryDateObject(value) : toStr.call(value) === dateClass;
};

Version data entries

67 entries across 67 versions & 10 rubygems

Version Path
disco_app-0.18.0 test/dummy/node_modules/is-date-object/index.js
disco_app-0.18.2 test/dummy/node_modules/is-date-object/index.js
disco_app-0.16.1 test/dummy/node_modules/is-date-object/index.js
disco_app-0.15.2 test/dummy/node_modules/is-date-object/index.js
disco_app-0.18.4 test/dummy/node_modules/is-date-object/index.js
disco_app-0.18.1 test/dummy/node_modules/is-date-object/index.js
disco_app-0.12.7.pre.puma.pre.3 test/dummy/node_modules/is-date-object/index.js
disco_app-0.14.0 test/dummy/node_modules/is-date-object/index.js
disco_app-0.13.6.pre.puma.pre.3 test/dummy/node_modules/is-date-object/index.js
learn_create-0.0.22 lib/templates/javascript_lab_template/node_modules/is-date-object/index.js
jester-data-8.0.0 node_modules/is-date-object/index.js
ezii-os-5.2.1 node_modules/is-date-object/index.js
ezii-os-2.0.1 node_modules/is-date-object/index.js
ezii-os-1.1.0 node_modules/is-date-object/index.js
ezii-os-1.0.0 node_modules/is-date-object/index.js
ezii-os-0.0.0.1.0 node_modules/is-date-object/index.js
ezii-os-0.0.0.0.1 node_modules/is-date-object/index.js
govuk_publishing_components-18.0.0 node_modules/is-date-object/index.js
govuk_publishing_components-17.21.0 node_modules/is-date-object/index.js
govuk_publishing_components-17.20.0 node_modules/is-date-object/index.js