首页课程展示数据渲染

This commit is contained in:
禺狨
2023-03-24 13:56:39 +08:00
parent 0dc5c49ef8
commit 95732983f7
4 changed files with 77 additions and 21 deletions

View File

@@ -18,17 +18,10 @@ export function dateFormat(dateStr: string) {
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() + "分";
}
}
let value = [];
value.push(Math.floor(d.asDays()));
value.push(d.hours());
value.push(d.minutes());
return value;
}