formatTime function refactored

This commit is contained in:
NikolaBorislavovHristov 2018-11-19 11:40:42 +02:00
parent 3fa5a87075
commit 3ea7e0ce25

View file

@ -86,10 +86,10 @@ class ControlBar extends Component {
} }
formatTime = (time) => { formatTime = (time) => {
const hours = Math.floor((time / (1000 * 60 * 60)) % 24); const hours = ('0' + Math.floor((time / (1000 * 60 * 60)) % 24)).slice(-2);
const minutes = Math.floor((time / (1000 * 60)) % 60); const minutes = ('0' + Math.floor((time / (1000 * 60)) % 60)).slice(-2);
const seconds = Math.floor((time / 1000) % 60); const seconds = ('0' + Math.floor((time / 1000) % 60)).slice(-2);
return `${('0' + hours).slice(-2)}:${('0' + minutes).slice(-2)}:${('0' + seconds).slice(-2)}`; return `${hours}:${minutes}:${seconds}`;
} }
renderTimeSlider() { renderTimeSlider() {