mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-05-02 05:47:14 +02:00
[refactor] pulling getTimestamp off Terminal
This commit is contained in:
+2
-6
@@ -38,6 +38,7 @@ import {containsAllStrings, longestCommonStart,
|
||||
import {addOffset} from "../utils/helpers/addOffset";
|
||||
import {isString} from "../utils/helpers/isString";
|
||||
import {arrayToString} from "../utils/helpers/arrayToString";
|
||||
import {getTimestamp} from "../utils/helpers/getTimestamp";
|
||||
import {logBoxCreate} from "../utils/LogBox";
|
||||
import {yesNoBoxCreate,
|
||||
yesNoBoxGetYesButton,
|
||||
@@ -115,7 +116,7 @@ $(document).keydown(function(event) {
|
||||
if (command.length > 0) {
|
||||
post(
|
||||
"[" +
|
||||
(FconfSettings.ENABLE_TIMESTAMPS ? Terminal.getTimestamp() + " " : "") +
|
||||
(FconfSettings.ENABLE_TIMESTAMPS ? getTimestamp() + " " : "") +
|
||||
Player.getCurrentServer().hostname +
|
||||
" ~]> " + command
|
||||
);
|
||||
@@ -646,11 +647,6 @@ let Terminal = {
|
||||
}
|
||||
},
|
||||
|
||||
getTimestamp: function() {
|
||||
const d = new Date();
|
||||
return `${d.getMonth() + 1}/${d.getDate()} ${`0${d.getHours()}`.slice(-2)}:${`0${d.getMinutes()}`.slice(-2)}`;
|
||||
},
|
||||
|
||||
finishAction: function(cancelled = false) {
|
||||
if (Terminal.hackFlag) {
|
||||
Terminal.finishHack(cancelled);
|
||||
|
||||
Reference in New Issue
Block a user