diff --git a/src/utils/common.js b/src/utils/common.js index 14dd8495d..8630a788f 100644 --- a/src/utils/common.js +++ b/src/utils/common.js @@ -1,4 +1,5 @@ const _ = require('lodash') +const moment = require('moment') function getTimeUnits(u) { const units = { @@ -169,7 +170,8 @@ export function getDayEnd(now) { if (!now) { now = new Date() } - return new Date(new Date(now.toLocaleDateString()).getTime() + 24 * 60 * 60 * 1000 - 1) + const zoneTime = moment(now).utc().endOf('month').format('YYYY-MM-DD HH:mm:ss') + return moment(zoneTime).utc().toDate() } export function setUrlParam(url, name, value) {