小小儁爺
7 天以前 6fabf169ee373a68196d84907eed9346089af9ee
src/utils/global.js
@@ -41,14 +41,21 @@
  return data.getFullYear() + '-' + month + '-' + date
}
// 时间处理函数  年月日   往前推一天
// 时间处理函数  年月日  时分秒  往前推一天
export function handleDateReduceOneDay(value) {
  const newDate = new Date(value)
  newDate.setDate(newDate.getDate() - 1)
  const data = new Date(newDate)
  const month = data.getMonth() < 9 ? '0' + (data.getMonth() + 1) : data.getMonth() + 1
  const date = data.getDate() <= 9 ? '0' + data.getDate() : data.getDate()
  return data.getFullYear() + '-' + month + '-' + date
  const dt = new Date(newDate)
  const wk = dt.getDay()
  const y = dt.getFullYear()
  const m = (dt.getMonth() + 1 + '').padStart(2, '0')
  const d = (dt.getDate() + '').padStart(2, '0')
  const hh = (dt.getHours() + '').padStart(2, '0')
  const mm = (dt.getMinutes() + '').padStart(2, '0')
  const ss = (dt.getSeconds() + '').padStart(2, '0')
  return `${y}-${m}-${d}  ${hh}:${mm}:${ss}`
}
// 事件处理函数  时分秒
@@ -67,7 +74,7 @@
  const week = weeks[wk]
  // return `${y}-${m}-${d}  ${hh}:${mm}:${ss}   ${week}`
  return `${y}-${m}-${d}  ${hh}:${mm}:${ss}`
  return `${y}-${m}-${d} ${hh}:${mm}:${ss}`
}
// 时间处理函数   返回 时分