Add function to get the time rather than minutes only

master
David Peer 2022-02-26 09:17:46 +01:00
parent 9daf898f1f
commit c6c86213d1
2 changed files with 10 additions and 0 deletions

View File

@ -25,6 +25,7 @@ The following functions are available:
- increaseTimer(int) -> void
- decreaseTimer(int) -> void
- getRemainingMinutes() -> int
- getRemainingTime() -> DateTime
Example to increase the timer by 5 and ensure that its started:
```Javascript

View File

@ -130,6 +130,15 @@
var now = new Date();
var diff = settings.goal - now;
return Math.ceil(diff / (1000*60));
}, getRemainingTime: function(){
if(!settings.started){
return;
}
var now = new Date();
var diff = settings.goal - now;
return getTime(diff);
}
};