Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
Fix counter
Browse files Browse the repository at this point in the history
  • Loading branch information
cdujeu committed Oct 15, 2016
1 parent e86e28e commit 774d64e
Showing 1 changed file with 3 additions and 3 deletions.
Expand Up @@ -6,9 +6,9 @@

// Compute next occurence of 0 or 30
let d = new Date();
let remainingMinutes = 30 - d.getMinutes() % 30;
let remainingSeconds = 60 - d.getSeconds();
if(remainingMinutes === 30) {
let remainingMinutes = 29 - d.getMinutes() % 30;
let remainingSeconds = 59 - d.getSeconds();
if(remainingMinutes === 0) {
this.setState({timeLeft: (remainingSeconds < 10 ? '0' + remainingSeconds : remainingSeconds) + 's' });
}else{
this.setState({timeLeft: remainingMinutes + '\'' + (remainingSeconds < 10 ? '0' + remainingSeconds : remainingSeconds) + 'mn' });
Expand Down

0 comments on commit 774d64e

Please sign in to comment.