// 秒转化为时间的格式化字符串
export function secondToFormatTime(times: number): string {
    if (times <= 0) return '--';
    let timeStr = '';
    let remain = times;

    let days = Math.floor(remain / (24 * 60 * 60));
    if (days) timeStr += `${days}天`;

    remain = remain % (24 * 60 * 60);
    let hours = Math.floor(remain / (60 * 60));
    if (hours) timeStr += `${hours}h`;

    remain = remain % (60 * 60);
    let minutes = Math.floor(remain / 60);
    if (minutes) timeStr += `${minutes}min`;

    let seconds = remain % 60;
    timeStr += `${seconds}s`;

    return timeStr;
}
