licp
2024-05-14 33c5011a860bb10efc4f8a4d4f6bc19bf9fecbb8
src/util/date.js
@@ -1,8 +1,7 @@
/**
 * 获取年月日
 */
export function getYearAndMonthAndDays() {
  const date = new Date()
export function getYearAndMonthAndDays(date=new Date()) {
  let year = date.getFullYear()
  let month = date.getMonth() + 1
  if (month < 10) {
@@ -13,9 +12,9 @@
  year = year + '-'
  let days = date.getDate()
  if (days < 10) {
    days = '0' + days + '-'
    days = '0' + days
  } else {
    days = days + '-'
    days = days
  }
  return (year + month + days)
}