mirror of
https://github.com/PlayEdu/frontend.git
synced 2025-12-23 18:59:44 +08:00
首页课程模块初步
This commit is contained in:
@@ -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++) {
|
||||
|
||||
Reference in New Issue
Block a user