课程详情初步

This commit is contained in:
禺狨
2023-03-24 17:45:47 +08:00
parent b24e4e09b1
commit 351e755fe2
13 changed files with 438 additions and 11 deletions

View File

@@ -16,8 +16,17 @@ export function dateFormat(dateStr: string) {
return moment(dateStr).format("YYYY-MM-DD HH:mm");
}
export function durationFormat(dateStr: number) {
var d = moment.duration(dateStr, "seconds");
let hour = d.hours() === 0 ? "" : d.hours() + ":";
let minute = d.minutes() >= 10 ? d.minutes() + ":" : "0" + d.minutes() + ":";
let second = d.seconds() >= 10 ? d.seconds() : "0" + d.seconds();
return hour + minute + second;
}
export function studyTimeFormat(dateStr: number) {
var d = moment.duration(dateStr/1000, "seconds");
var d = moment.duration(dateStr / 1000, "seconds");
let value = [];
value.push(Math.floor(d.asDays()));
value.push(d.hours());