mirror of
https://github.com/PlayEdu/backend
synced 2025-06-29 01:14:20 +08:00
时间渲染为空时显示优化
This commit is contained in:
parent
e7a63c350f
commit
2afada157d
@ -13,10 +13,16 @@ export function clearToken() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function dateFormat(dateStr: string) {
|
export function dateFormat(dateStr: string) {
|
||||||
|
if (!dateStr) {
|
||||||
|
return "-";
|
||||||
|
}
|
||||||
return moment(dateStr).format("YYYY-MM-DD HH:mm");
|
return moment(dateStr).format("YYYY-MM-DD HH:mm");
|
||||||
}
|
}
|
||||||
|
|
||||||
export function timeFormat(dateStr: number) {
|
export function timeFormat(dateStr: number) {
|
||||||
|
if (!dateStr) {
|
||||||
|
return "-";
|
||||||
|
}
|
||||||
var d = moment.duration(dateStr, "seconds");
|
var d = moment.duration(dateStr, "seconds");
|
||||||
let value =
|
let value =
|
||||||
Math.floor(d.asDays()) +
|
Math.floor(d.asDays()) +
|
||||||
|
Loading…
x
Reference in New Issue
Block a user