Skip to content

Commit

Permalink
fix floating bug for >1h
Browse files Browse the repository at this point in the history
  • Loading branch information
RoderickQiu committed Dec 27, 2023
1 parent fadfa90 commit db4d6d2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion floating.html
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@
let h = " " + i18n.__("h"), min = " " + i18n.__("min"), s = " " + i18n.__("s");

function getStyledTimeLeft(minute) {
minute = Number(minute);
if (lastTimeHasHours == null) {
lastTimeHasHours = Math.floor(minute / 60) > 0;
if (!lastTimeHasHours) {
Expand All @@ -117,7 +118,7 @@
timeLeft.addClass("h6");
lastTimeHasHours = true;
}
return hour + Math.floor(h) + Math.ceil(Math.floor(minute - hour * 60)) + min;
return Math.floor(hour) + h + Math.ceil(Math.floor(minute - hour * 60)) + min;
} else {
if (lastTimeHasHours) {
timeLeft.removeClass("h6");
Expand Down

0 comments on commit db4d6d2

Please sign in to comment.