Skip to content

Commit

Permalink
fix timeleft
Browse files Browse the repository at this point in the history
  • Loading branch information
KipK committed Jun 1, 2023
1 parent e620101 commit 97e40e0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,11 @@ export const removeDuplicateObjects = (array, key) => {
export function sec2time(sec) {
if (!sec)
sec = 0
return new Date(sec * 1000).toISOString().slice(11, 19)
const hours = Math.floor(sec / 3600)
sec %= 3600
const minutes = Math.floor(sec / 60);
const seconds = sec % 60;
return hours.toLocaleString('en-US', { minimumIntegerDigits: 2, useGrouping: false }) + ':' + minutes.toLocaleString('en-US', { minimumIntegerDigits: 2, useGrouping: false }) + ':' + seconds.toLocaleString('en-US', { minimumIntegerDigits: 2, useGrouping: false })
}

export function formatDate(t,z,format=null) {
Expand Down

0 comments on commit 97e40e0

Please sign in to comment.