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
This commit is contained in:
parent
dee2e88648
commit
c1fa39d0a7
1 changed files with 6 additions and 5 deletions
|
@ -25,20 +25,21 @@ const config = require(__dirname + BASE_PATH + "/config.json");
|
||||||
module.exports = {
|
module.exports = {
|
||||||
// Prints a bit of information to the console
|
// Prints a bit of information to the console
|
||||||
printInfo:function(emoji, s) {
|
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
|
// Prints a warning to the console
|
||||||
printWarn:function(emoji, s) {
|
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
|
// Prints an error to the console
|
||||||
printError:function(emoji, s) {
|
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();
|
const time = new Date();
|
||||||
// Check if the user wants 24 hour or 12 hour time
|
// Check if the user wants 24 hour or 12 hour time
|
||||||
if (config["24hour"]) {
|
if (config["24hour"]) {
|
||||||
|
|
Loading…
Reference in a new issue