1var isObjectLike = require('../internal/isObjectLike'); 2 3/** `Object#toString` result references. */ 4var dateTag = '[object Date]'; 5 6/** Used for native method references. */ 7var objectProto = Object.prototype; 8 9/** 10 * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring) 11 * of values. 12 */ 13var objToString = objectProto.toString; 14 15/** 16 * Checks if `value` is classified as a `Date` object. 17 * 18 * @static 19 * @memberOf _ 20 * @category Lang 21 * @param {*} value The value to check. 22 * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. 23 * @example 24 * 25 * _.isDate(new Date); 26 * // => true 27 * 28 * _.isDate('Mon April 23 2012'); 29 * // => false 30 */ 31function isDate(value) { 32 return isObjectLike(value) && objToString.call(value) == dateTag; 33} 34 35module.exports = isDate; 36 37