diff --git a/src/utils/dateutils.js b/src/utils/dateutils.js index 046d1cc..92f521d 100644 --- a/src/utils/dateutils.js +++ b/src/utils/dateutils.js @@ -5,10 +5,16 @@ return new Date(nowTimeDate) } -export function getToday(fmt) { // 默认显示今天 +export function getToday(fmt = 'yyyy-MM-dd hh:mm:ss') { // 默认显示今天 return new Date().Format(fmt) } +export function getTodayZero(fmt = 'yyyy-MM-dd hh:mm:ss') { // 获取当天的0点 + const nowTimeDate = new Date() + nowTimeDate.setHours(0, 0, 0, 0) + return nowTimeDate.Format(fmt) +} + export function getYesterDay() { // 默认显示昨天 const ct_month = new Date() ct_month.setTime(ct_month.getTime() - 3600 * 1000 * 24)