Skip to content

Commit

Permalink
use _.isDate to check if object is a Date object (#335)
Browse files Browse the repository at this point in the history
  • Loading branch information
joliveros authored and dprothero committed Apr 4, 2018
1 parent cba0803 commit 51e3cab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/base/serialize.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ module.exports = {};
* @return {string|object} date formatted in YYYY-MM-DD form
*/
module.exports.iso8601Date = function(d) {
if (_.isUndefined(d) || _.isString(d) || !((d instanceof Date))) {
if (_.isUndefined(d) || _.isString(d) || !(_.isDate(d))) {
return d;
} else {
return moment.utc(d).format('YYYY-MM-DD');
Expand Down

0 comments on commit 51e3cab

Please sign in to comment.