feat : 新增历史数据导出csv文件
This commit is contained in:
@@ -18,9 +18,22 @@ export const dateFormat = (time = new Date().getTime(),flag) => { //YYYY年MM月
|
||||
return `${Y}年${M}月${D}日 星期${week}`;
|
||||
}
|
||||
}
|
||||
|
||||
export const getNowFormatDate = (flag) => {
|
||||
let date = new Date(),
|
||||
year = date.getFullYear(), //获取完整的年份(4位)
|
||||
month = date.getMonth() + 1, //获取当前月份(0-11,0代表1月)
|
||||
strDate = date.getDate() // 获取当前日(1-31)
|
||||
if (month < 10) month = `0${month}` // 如果月份是个位数,在前面补0
|
||||
if (strDate < 10) strDate = `0${strDate}` // 如果日是个位数,在前面补0
|
||||
if(flag){
|
||||
return `${year}-${month}-${strDate}`
|
||||
}else {
|
||||
return `${year}-${month}`
|
||||
}
|
||||
}
|
||||
export default {
|
||||
dateFormat
|
||||
dateFormat,
|
||||
getNowFormatDate
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user