From c035ffc6cd17acf46eb8bd90fc0578803227ffb0 Mon Sep 17 00:00:00 2001 From: xiangpei <xiangpei@timesnew.cn> Date: 星期五, 07 六月 2024 15:00:20 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- src/utils/index.js | 21 +++++++++++++++++++++ 1 files changed, 21 insertions(+), 0 deletions(-) diff --git a/src/utils/index.js b/src/utils/index.js index b46bf3a..88c408d 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -351,3 +351,24 @@ ele.className = ele.className.replace(reg, ' ') } } + +export function formatSeconds (theTime) { + let theTime1 = 0 + let theTime2 = 0 + if (theTime > 60) { + theTime1 = parseInt(theTime / 60) + theTime = parseInt(theTime % 60) + if (theTime1 > 60) { + theTime2 = parseInt(theTime1 / 60) + theTime1 = parseInt(theTime1 % 60) + } + } + let result = '' + parseInt(theTime) + '绉�' + if (theTime1 > 0) { + result = '' + parseInt(theTime1) + '鍒�' + result + } + if (theTime2 > 0) { + result = '' + parseInt(theTime2) + '灏忔椂' + result + } + return result +} \ No newline at end of file -- Gitblit v1.8.0