Skip to content

Commit

Permalink
Fix display of timers beyond 24 hours.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jim Posen committed Oct 31, 2017
1 parent 8590b57 commit e2119ac
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions the-button/src/util.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
export function breakDownTimeInterval(seconds) {
const secondsInMinute = 60;
const secondsInHour = 60 * secondsInMinute;
const secondsInDay = 24 * secondsInHour;

const days = Math.floor(seconds / secondsInDay);
seconds = seconds % secondsInDay;
const hours = Math.floor(seconds / secondsInHour);
seconds = seconds % secondsInHour;
const minutes = Math.floor(seconds / secondsInMinute);
seconds = seconds % secondsInMinute;

return {days, hours, minutes, seconds};
return {hours, minutes, seconds};
}

export function formatCountdown(remainingTime) {
Expand Down

0 comments on commit e2119ac

Please sign in to comment.