首页课程模块初步

This commit is contained in:
禺狨
2023-03-24 12:02:12 +08:00
parent 42f545e68b
commit 0dc5c49ef8
11 changed files with 374 additions and 8 deletions

View File

@@ -16,6 +16,22 @@ export function dateFormat(dateStr: string) {
return moment(dateStr).format("YYYY-MM-DD HH:mm");
}
export function studyTimeFormat(dateStr: number) {
var d = moment.duration(dateStr, "seconds");
let value =
Math.floor(d.asDays()) + "天" + d.hours() + "时" + d.minutes() + "分";
if (Math.floor(d.asDays()) === 0) {
if (d.hours() === 0) {
value = d.minutes() + "分";
} else {
value = d.hours() + "时" + d.minutes() + "分";
}
}
return value;
}
export function generateUUID(): string {
let guid = "";
for (let i = 1; i <= 32; i++) {