Permalink
Browse files

Display seconds when on '30' modulo.

  • Loading branch information...
1 parent 373a471 commit 4d708fbce43ed86fad1203a624629cb0843edada @cdujeu cdujeu committed Oct 15, 2016
Showing with 5 additions and 1 deletion.
  1. +5 −1 core/src/plugins/action.demo_counter/react/DemoDeathCounter.js
@@ -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' });
+ }
},

0 comments on commit 4d708fb

Please sign in to comment.