refactor: timezone conversion in lib/utils/date.js (#7438)

This commit is contained in:
Queensferry
2021-05-09 05:45:37 +08:00
committed by GitHub
parent ca12701215
commit 10f5bb7bce
6 changed files with 27 additions and 9 deletions

4
lib/utils/parse-date.js Normal file
View File

@@ -0,0 +1,4 @@
const dayjs = require("dayjs");
dayjs.extend(require('dayjs/plugin/customParseFormat'));
module.exports = (date, ...options) => dayjs(date, ...options).toDate();