diff options
author | Sam Potts <sam@potts.es> | 2019-01-06 14:07:07 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-06 14:07:07 +1100 |
commit | 10c88f6e4936d522f249b78f0d02d4ea4e198030 (patch) | |
tree | 3c7fe5e5342d94162d10a1755ab527bee33e6183 /src/js/utils/time.js | |
parent | 973527cb84a7e14ea772fef6d1895578b130318d (diff) | |
parent | 6d9d315ca741f5472902c0f961591fdff9bbf946 (diff) | |
download | plyr-10c88f6e4936d522f249b78f0d02d4ea4e198030.tar.lz plyr-10c88f6e4936d522f249b78f0d02d4ea4e198030.tar.xz plyr-10c88f6e4936d522f249b78f0d02d4ea4e198030.zip |
Merge pull request #1295 from taion/Math.trunc
fix: Use Math.trunc instead of parseInt
Diffstat (limited to 'src/js/utils/time.js')
-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) { |