Blame view

src/utils/formate.js 751 Bytes
0afb4b58   liuqimichale   headertime
1
  function formateday() {
49ed5b07   liuqimichale   headertime
2
3
4
5
6
    let date = new Date()
    let str = ''
    let year = date.getFullYear()
    let month = date.getMonth()+1<10? "0"+ (date.getMonth()+1) : date.getMonth()+1
    let day = date.getDate()<10 ? "0"+date.getDate() : date.getDate
0afb4b58   liuqimichale   headertime
7
8
9
    str = year +"-"+ month +"-"+ day
    return str
  }
3e5ad56c   liuqimichale   日期
10
  
0afb4b58   liuqimichale   headertime
11
12
13
  function formateTime() {
    let date = new Date()
    let str = ''
49ed5b07   liuqimichale   headertime
14
15
16
17
    let hours = date.getHours()<10? "0"+date.getHours() : date.getHours()
    let minutes=date.getMinutes()<10 ? "0"+date.getMinutes() : date.getMinutes();
    let seconds=date.getSeconds()<10 ? "0"+date.getSeconds() : date.getSeconds();
  
0afb4b58   liuqimichale   headertime
18
    str = hours+":"+minutes+":"+seconds
49ed5b07   liuqimichale   headertime
19
20
21
    return str
  }
  
f9b345a2   liuqimichale   全局filters
22
23
24
25
26
  function formaterTotal(val) {
    return val.split('')
  }
  
  export  { formateday, formateTime, formaterTotal }