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.
13 lines
270 B
13 lines
270 B
6 years ago
|
/* eslint-env browser */
|
||
|
import prettyMs from 'pretty-ms';
|
||
|
|
||
|
const formatSeconds = seconds => {
|
||
|
const ms = seconds * 1000;
|
||
|
const pretty = prettyMs(ms);
|
||
|
|
||
|
// Only return first two periods
|
||
|
return pretty.split(' ').slice(0, 2).join(' ')
|
||
|
};
|
||
|
|
||
|
export default formatSeconds;
|