Skip to content

Commit

Permalink
Actual fix for largest unit check
Browse files Browse the repository at this point in the history
  • Loading branch information
ChasarooniZ committed Nov 12, 2024
1 parent f88fd9b commit 440e0a1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/styling.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ function formatTime(seconds, format = 'symbols') {
const count = Math.floor(seconds / unit.seconds);
if (count > 0) {
result.push({ name: unit.name, count: count, remainder: seconds % unit.seconds });
if (!largestUnit) largestUnit = { name: unit.name, count: count, remainder: seconds % unit.seconds };
if (!largestUnit.count) largestUnit = { name: unit.name, count: count, remainder: seconds % unit.seconds };
seconds %= unit.seconds;
}
}
Expand Down

0 comments on commit 440e0a1

Please sign in to comment.