riku
2024-01-09 023ea35893ed047887a43555509335eec7a8b161
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import dayjs from "dayjs";
 
export default {
  format(date, template) {
    return dayjs(date).format(template)
  },
 
  formatH(date){
    if (date) {
      return this.format(date, 'HH:mm:ss')
    } else {
      return '--:--:--'
    }
  },
 
  formatYMD(date){
    if (date) {
      return this.format(date, 'YYYY-MM-DD')
    } else {
      return '----/--/--'
    }
  },
 
  formatYMDH(date){
    if (date) {
      return this.format(date, 'YYYY-MM-DD HH:mm:ss')
    } else {
      return '----/--/-- --:--:--'
    }
  },
}