mirror of
https://github.com/PlayEdu/backend
synced 2026-03-10 11:51:57 +08:00
首页概览数据
This commit is contained in:
@@ -18,6 +18,24 @@ export function dateFormat(dateStr: string) {
|
||||
return moment(dateStr).format("YYYY-MM-DD HH:mm");
|
||||
}
|
||||
|
||||
export function timeFormat(dateStr: number) {
|
||||
var d = moment.duration(dateStr, "seconds");
|
||||
let value =
|
||||
Math.floor(d.asDays()) +
|
||||
"天" +
|
||||
d.hours() +
|
||||
"时" +
|
||||
d.minutes() +
|
||||
"分" +
|
||||
d.seconds() +
|
||||
"秒";
|
||||
|
||||
if (Math.floor(d.asDays()) === 0) {
|
||||
value = d.hours() + "时" + d.minutes() + "分" + d.seconds() + "秒";
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
export function generateUUID(): string {
|
||||
let guid = "";
|
||||
for (let i = 1; i <= 32; i++) {
|
||||
|
||||
Reference in New Issue
Block a user