Skip to content

Commit

Permalink
Merge pull request #3788 from SukkaW/drop-lodash-for-date-helper
Browse files Browse the repository at this point in the history
refactor(date_helper): drop lodash
  • Loading branch information
segayuu authored Oct 23, 2019
2 parents 7e48df3 + 207f0ce commit d8ec214
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/plugins/helper/date.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit d8ec214

Please sign in to comment.