[bug] Fixing the timestamp

getMonth() is 0-based, so changing the offset.

getDay() is the day of week, not day of the month.

Ensuring hours & minutes are always two digits.
This commit is contained in:
Steven Evans 2018-08-01 12:55:01 -04:00
parent fabc45f496
commit 0345daf359

@ -647,8 +647,8 @@ let Terminal = {
},
getTimestamp: function() {
let d = new Date();
return (d.getMonth() + "/" + d.getDay() + " " + d.getHours() + ":" + d.getMinutes());
const d = new Date();
return `${d.getMonth() + 1}/${d.getDate()} ${`0${d.getHours()}`.slice(-2)}:${`0${d.getMinutes()}`.slice(-2)}`;
},
finishAction: function(cancelled = false) {