邓洁 : 修改大屏样式

This commit is contained in:
邓洁
2023-12-08 22:12:37 +08:00
parent 28ff50193c
commit a0b12dcbdc
7 changed files with 114 additions and 77 deletions

24
src/utils/date.js Normal file
View File

@@ -0,0 +1,24 @@
export const dateFormat = (time = new Date().getTime()) => { //YYYY年MM月DD日 星期d
const _time = time.toString().length > 10 ? time : time * 1000
const weekList = ["一", "二", "三", "四", "五", "六", "日"];
const date = new Date(_time);
const Y = date.getFullYear();
const M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1);
const D = (date.getDate() < 10 ? '0' + date.getDate() : date.getDate());
const h = (date.getHours() < 10 ? '0' + date.getHours() : date.getHours());
const m = (date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes());
const s = (date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds());
let weekDay = new Date().getDay();
const week= weekList[weekDay - 1]
// const strDate = `${Y}/${M}/${D} ${h}:${m}:${s}`
return `${Y}${M}${D}日 星期${week}`;
}
export default {
dateFormat
}