Skip to content

Commit d8ec214

Browse files
authored
Merge pull request #3788 from SukkaW/drop-lodash-for-date-helper
refactor(date_helper): drop lodash
2 parents 7e48df3 + 207f0ce commit d8ec214

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/plugins/helper/date.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,13 @@
22

33
const moment = require('moment-timezone');
44
const { isMoment } = moment;
5-
const isDate = require('lodash/isDate');
5+
6+
const isDate = (value) => {
7+
if (typeof value === 'object') {
8+
if (value instanceof Date) return !isNaN(value.getTime());
9+
}
10+
return false;
11+
};
612

713
function getMoment(date, lang, timezone) {
814
if (date == null) date = moment();

0 commit comments

Comments
 (0)