diff options
author | Jimmy Jia <tesrin@gmail.com> | 2018-12-20 13:05:14 -0500 |
---|---|---|
committer | Jimmy Jia <tesrin@gmail.com> | 2018-12-20 13:06:29 -0500 |
commit | 6d9d315ca741f5472902c0f961591fdff9bbf946 (patch) | |
tree | 3c7fe5e5342d94162d10a1755ab527bee33e6183 /src | |
parent | 973527cb84a7e14ea772fef6d1895578b130318d (diff) | |
download | plyr-6d9d315ca741f5472902c0f961591fdff9bbf946.tar.lz plyr-6d9d315ca741f5472902c0f961591fdff9bbf946.tar.xz plyr-6d9d315ca741f5472902c0f961591fdff9bbf946.zip |
fix: Use Math.trunc instead of parseInt
Diffstat (limited to 'src')
-rw-r--r-- | src/js/utils/time.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/js/utils/time.js b/src/js/utils/time.js index 7c9860fd..2deccf65 100644 --- a/src/js/utils/time.js +++ b/src/js/utils/time.js @@ -5,9 +5,9 @@ import is from './is'; // Time helpers -export const getHours = value => parseInt((value / 60 / 60) % 60, 10); -export const getMinutes = value => parseInt((value / 60) % 60, 10); -export const getSeconds = value => parseInt(value % 60, 10); +export const getHours = value => Math.trunc((value / 60 / 60) % 60, 10); +export const getMinutes = value => Math.trunc((value / 60) % 60, 10); +export const getSeconds = value => Math.trunc(value % 60, 10); // Format time to UI friendly string export function formatTime(time = 0, displayHours = false, inverted = false) { |