mirror of
https://github.com/PlayEdu/frontend.git
synced 2025-12-23 18:59:44 +08:00
首页课程展示数据渲染
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user