You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
318 B
18 lines
318 B
2 years ago
|
/**
|
||
|
* 秒转为分:秒格式
|
||
|
*
|
||
|
* 示例:
|
||
|
* (68) => 01:08
|
||
|
*/
|
||
|
import timeDiff from './timeDiff';
|
||
|
|
||
|
export default function (second) {
|
||
|
const { d, h, i, s } = timeDiff(second * 1000);
|
||
|
|
||
|
if(d > 0 || h > 0){
|
||
|
return '59:59';
|
||
|
} else {
|
||
|
return ('0' + i).slice(-2) + ':' + ('0' + s).slice(-2);
|
||
|
}
|
||
|
}
|