Skip to content

Commit 725140d

Browse files
author
Alan Smith
committed
Fix incorrect week count
1 parent c2686f3 commit 725140d

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/components/Event.vue

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -85,20 +85,20 @@ export default {
8585
8686
methods: {
8787
calculateCountdownProgress({ weeks, days, hours, minutes, seconds }) {
88-
const weekCount = Math.round(days / 7);
89-
const dayCount = days % 7;
88+
const weekCount = Math.floor(days / 7);
89+
const dayCount = days % 7;
9090
91-
this.weekString = this.getTimeString(weekCount, 'week');
91+
this.weekString = this.getTimeString(weekCount, 'week');
9292
93-
this.dayString = this.getTimeString(dayCount, 'day');
93+
this.dayString = this.getTimeString(dayCount, 'day');
9494
95-
this.hourString = this.getTimeString(hours, 'hour');
95+
this.hourString = this.getTimeString(hours, 'hour');
9696
97-
this.minuteString = this.getTimeString(minutes, 'minute');
97+
this.minuteString = this.getTimeString(minutes, 'minute');
9898
99-
this.secondString = this.getTimeString(seconds, 'second');
99+
this.secondString = this.getTimeString(seconds, 'second');
100100
101-
if (!this.isReady) this.isReady = true;
101+
if (!this.isReady) this.isReady = true;
102102
},
103103
104104
getTimeString(value, type) {

0 commit comments

Comments
 (0)