Add option to use timestamp on timer command
This commit is contained in:
parent
6f7ec05dd0
commit
88d5237680
2 changed files with 6 additions and 3 deletions
|
@ -1,4 +1,4 @@
|
|||
module.exports = function(time){
|
||||
module.exports = function(time, currentUnixTime){
|
||||
let timeInSeconds = parseFloat(time.slice(0, time.length - 1))
|
||||
let letter = time.slice(time.length - 1)
|
||||
if(!isNaN(letter)) return parseFloat(time) * 60;
|
||||
|
@ -14,6 +14,9 @@ module.exports = function(time){
|
|||
case "D":
|
||||
timeInSeconds = timeInSeconds * 86400;
|
||||
break;
|
||||
case "T": // TODO: Make it so that I can have multiple letters per case, so that "TS" would work here.
|
||||
timeInSeconds = timeInSeconds - currentUnixTime;
|
||||
break;
|
||||
default:
|
||||
timeInSeconds = NaN;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue