From c1fa39d0a763a411b8667eeb36f83697de453f91 Mon Sep 17 00:00:00 2001 From: tgpethan-alt <75017614+tgpethan-alt@users.noreply.github.com> Date: Wed, 25 Nov 2020 10:41:37 +0000 Subject: [PATCH] Rename the getTime24 function to better reflect it's output getTime24 used to only output 24 hour time but 12 hour time support was added a while back so it should be renamed to better reflect how it works --- modules/consoleHelper.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/modules/consoleHelper.js b/modules/consoleHelper.js index 34c1f31..3c40fcf 100644 --- a/modules/consoleHelper.js +++ b/modules/consoleHelper.js @@ -25,20 +25,21 @@ const config = require(__dirname + BASE_PATH + "/config.json"); module.exports = { // Prints a bit of information to the console printInfo:function(emoji, s) { - console.log(chalk.green(`[${this.getTime24()}] `)+chalk.bgGreen(chalk.black(" INFO "))+` ${emoji} ${s}`); + console.log(chalk.green(`[${this.getTime()}] `)+chalk.bgGreen(chalk.black(" INFO "))+` ${emoji} ${s}`); }, // Prints a warning to the console printWarn:function(emoji, s) { - console.warn(chalk.green(`[${this.getTime24()}] `)+chalk.bgYellow(chalk.black(" WARN "))+` ${emoji} ${s}`); + console.warn(chalk.green(`[${this.getTime()}] `)+chalk.bgYellow(chalk.black(" WARN "))+` ${emoji} ${s}`); }, // Prints an error to the console printError:function(emoji, s) { - console.error(chalk.green(`[${this.getTime24()}] `)+chalk.bgRed(chalk.black(" ERROR "))+` ${emoji} ${s}`); + console.error(chalk.green(`[${this.getTime()}] `)+chalk.bgRed(chalk.black(" ERROR "))+` ${emoji} ${s}`); }, - getTime24:function() { + // Gets the current time in either 24 or 12 hour time + getTime:function() { const time = new Date(); // Check if the user wants 24 hour or 12 hour time if (config["24hour"]) { @@ -78,4 +79,4 @@ function correctValue(i) { } else { return i; } -} \ No newline at end of file +} -- 2.47.0