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

Commit

Permalink
Display seconds when on '30' modulo.
Browse files Browse the repository at this point in the history
  • Loading branch information
cdujeu committed Oct 15, 2016
1 parent 373a471 commit 4d708fb
Showing 1 changed file with 5 additions and 1 deletion.
Expand Up @@ -8,7 +8,11 @@
let d = new Date();
let remainingMinutes = 30 - d.getMinutes() % 30;
let remainingSeconds = 60 - d.getSeconds();
this.setState({timeLeft: remainingMinutes + '\'' + (remainingSeconds < 10 ? '0' + remainingSeconds : remainingSeconds) + 'mn' });
if(remainingMinutes === 30) {
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 4d708fb

Please sign in to comment.