Skip to content

Commit

Permalink
Fix countdowns over a hour (#2853)
Browse files Browse the repository at this point in the history
  • Loading branch information
bastianjoel authored Oct 24, 2023
1 parent 749588e commit a6e8d16
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
}

.countdown-wrapper {
width: 170px;
min-width: 170px;
text-align: right !important;
position: relative;
height: 100%;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,10 @@ export class CountdownTimeComponent implements OnDestroy {
}

const time = new Date(seconds * 1000);
const m = `0` + time.getMinutes();
const m = Math.floor(+time / 1000 / 60).toString();
const s = `0` + time.getSeconds();

this.time = m.slice(-2) + `:` + s.slice(-2);
this.time = (m.length < 2 ? `0` : ``) + m + `:` + s.slice(-2);

if (negative) {
this.time = `-` + this.time;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
margin: 80px 0px 10px 10px;
padding: 10px 44px 10px 10px;
min-height: 60px;
width: 230px;
min-width: 230px;
font-size: 3.7em;
font-weight: bold;
text-align: right;
Expand Down

0 comments on commit a6e8d16

Please sign in to comment.