From e452b61bd72beea8e91de02a0e66ff7db5363d09 Mon Sep 17 00:00:00 2001 From: mackt <1033530438@qq.com> Date: Mon, 8 Apr 2024 10:35:09 +0800 Subject: [PATCH] fix(AudioPlayer): Fix time format. --- src/components/AudioPlayer/PlayerControl.tsx | 5 ++--- src/utils/{timeFormat.ts => time.ts} | 1 - 2 files changed, 2 insertions(+), 4 deletions(-) rename src/utils/{timeFormat.ts => time.ts} (99%) diff --git a/src/components/AudioPlayer/PlayerControl.tsx b/src/components/AudioPlayer/PlayerControl.tsx index 6982f9a..8252927 100644 --- a/src/components/AudioPlayer/PlayerControl.tsx +++ b/src/components/AudioPlayer/PlayerControl.tsx @@ -2,7 +2,7 @@ import Image from 'next/image'; -import { secondToDate } from '@/utils/timeFormat'; +import { secondToDate } from '@/utils/time'; import { AutoScrollContainer } from '@/components'; @@ -71,7 +71,7 @@ export default function AudioPlayer({ {/* time */}

{`${secondToDate(trackProgress)}`} - {` /${secondToDate(duration)}`} + {` /${secondToDate(duration || 0)}`}

@@ -96,7 +96,6 @@ export default function AudioPlayer({ className="flex justify-center items-center w-[54px] h-[54px] mx-[35px] rounded-[50%] bg-[rgba(180,67,67,1)] overflow-hidden" onClick={onPlay} > - {/* play */} pause string = (second) => { const h = hourNum ? `${hourNum}:` : ''; const m = minuteNum ? `${unitAddZero(minuteNum)}:` : `00:`; const s = unitAddZero(secondNum); - return `${h}${m}${s}`; };