From 897fdc3b12197ea2502008aafea35b0afeadddc6 Mon Sep 17 00:00:00 2001 From: BTMuli Date: Thu, 4 Sep 2025 18:30:30 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20=E4=BC=98=E5=8C=96=E8=BE=93?= =?UTF-8?q?=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/toolFunc.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/utils/toolFunc.ts b/src/utils/toolFunc.ts index d75bf3f2..a9b0f0b1 100644 --- a/src/utils/toolFunc.ts +++ b/src/utils/toolFunc.ts @@ -1,7 +1,7 @@ /** * @file utils/toolFunc.ts * @description 一些工具函数 - * @since Beta v0.7.9 + * @since Beta v0.8.0 */ import { AvatarExtResTypeEnum, AvatarExtTypeEnum } from "@enum/bbs.js"; @@ -16,15 +16,16 @@ import { AppCharacterData, AppWeaponData } from "@/data/index.js"; /** * @description 时间戳转换为时间字符串 + * @since Beta v0.8.0 + * @param {number} time - 时间戳(毫秒) * @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 + return `${day === 0 ? "" : `${day}天 `}${hour.toFixed(0).padStart(2, "0")}:${minute .toFixed(0) .padStart(2, "0")}:${second.toFixed(0).padStart(2, "0")}`; }