format peak time frame properly
Some checks failed
Publish Docker Image / docker (push) Has been cancelled

This commit is contained in:
Lee
2023-12-31 01:07:32 +00:00
parent 5c5e44ad20
commit 565b533ad4
3 changed files with 37 additions and 6 deletions

View File

@ -6,6 +6,7 @@ const MessageOf = require("./message");
const config = require("../config");
const minecraftVersions = require("../minecraft_versions");
const { formatMsToTime } = require("./utils/timeUtils");
class App {
serverRegistrations = [];
@ -74,9 +75,11 @@ class App {
// Send configuration data for rendering the page
return {
// graphDurationLabel:
// config.graphDurationLabel ||
// Math.floor(config.graphDuration / (60 * 60 * 1000)) + "h",
graphDurationLabel:
config.graphDurationLabel ||
Math.floor(config.graphDuration / (60 * 60 * 1000)) + "h",
config.graphDurationLabel || formatMsToTime(config.graphDuration),
graphMaxLength: TimeTracker.getMaxGraphDataLength(),
serverGraphMaxLength: TimeTracker.getMaxServerGraphDataLength(),
servers: this.serverRegistrations.map((serverRegistration) =>