no message
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
|
||||
|
||||
|
||||
export default {
|
||||
formatDate (date,val) {
|
||||
let y = date.getFullYear();
|
||||
let m = date.getMonth()+1;
|
||||
let d = date.getDate();
|
||||
let h = date.getHours();
|
||||
let mm = date.getMinutes();
|
||||
let s = date.getSeconds();
|
||||
if(m <= 9){
|
||||
m = '0' + m;
|
||||
}
|
||||
if(d <= 9){
|
||||
d = '0' + d;
|
||||
}
|
||||
if(h <= 9){
|
||||
h = '0' + h;
|
||||
}
|
||||
if(mm <= 9){
|
||||
mm = '0' + mm;
|
||||
}
|
||||
if(s <= 9){
|
||||
s = '0' + s;
|
||||
}
|
||||
|
||||
let tmpTime = '';
|
||||
if(val == 0){
|
||||
tmpTime = `${h}:${mm}`;
|
||||
}else if(val == 1){
|
||||
tmpTime = `${m}-${d}`;
|
||||
}else if(val == 2){
|
||||
tmpTime = `${y}-${m}-${d} ${h}:${mm}:${s}`;
|
||||
}else if(val == 3){
|
||||
tmpTime = `${y}-${m}-${d}`;
|
||||
}
|
||||
return tmpTime;
|
||||
},
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user