bug
jiangping
2023-12-06 1f4e7d0f73a73e7350cf5a1df279d5f30904c5d5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
export function getAssets(url) {
  // console.log(url, new URL(`../assets/img/${url}`, import.meta.url).href);
  return new URL(`../assets/img/${url}`, import.meta.url).href
}
 
export function dateToSub(date) {
  if (!date) {
    return '-'
  }
  let tempDate = new Date(date)
  let month = tempDate.getMonth()+1
  let day = tempDate.getDate()
  let hours = tempDate.getHours()
  let minute = tempDate.getMinutes()
  return `${month<10?`0${month}`:month}-${day<10?`0${day}`:day} ${hours<10?`0${hours}`:hours}:${minute<10?`0${minute}`:minute}`
}