diff --git a/lib/plugins/helper/date.js b/lib/plugins/helper/date.js index 8bad844b9d..371a3449bf 100644 --- a/lib/plugins/helper/date.js +++ b/lib/plugins/helper/date.js @@ -2,7 +2,13 @@ const moment = require('moment-timezone'); const { isMoment } = moment; -const isDate = require('lodash/isDate'); + +const isDate = (value) => { + if (typeof value === 'object') { + if (value instanceof Date) return !isNaN(value.getTime()); + } + return false; +}; function getMoment(date, lang, timezone) { if (date == null) date = moment();