晏有为
2024-05-27 5d156b1e222bab30e4f5517a00626a86fc7c85e1
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) {
@@ -12,5 +11,10 @@
  }
  year = year + '-'
  let days = date.getDate()
  return year + month + days
  if (days < 10) {
    days = '0' + days
  } else {
    days = days
  }
  return (year + month + days)
}