♻️ 样式调整,慢慢改吧

This commit is contained in:
BTMuli
2023-09-01 16:55:43 +08:00
parent 2c129351c1
commit 343c83b185
17 changed files with 119 additions and 86 deletions

21
src/utils/toolFunc.ts Normal file
View File

@@ -0,0 +1,21 @@
/**
* @file utils toolFunc.ts
* @description 一些工具函数
* @author BTMuli <bt-muli@outlook.com>
* @since Beta v0.3.0
*/
/**
* @description 时间戳转换为时间字符串
* @returns {string} 时间字符串 d天 hh:mm:ss
* @param time
*/
export function stamp2LastTime(time: number): string {
const day = Math.floor(time / (24 * 3600 * 1000));
const hour = Math.floor((time % (24 * 3600 * 1000)) / (3600 * 1000));
const minute = Math.floor((time % (3600 * 1000)) / (60 * 1000));
const second = Math.floor((time % (60 * 1000)) / 1000);
return `${day === 0 ? "" : `${day}`} ${hour.toFixed(0).padStart(2, "0")}:${minute
.toFixed(0)
.padStart(2, "0")}:${second.toFixed(0).padStart(2, "0")}`;
}