3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-10 12:25:02 +00:00

Add support for server-specific timezone and date format settings

This commit is contained in:
Dragory 2020-08-10 00:24:06 +03:00
parent ddbbc543c2
commit c67a1df11d
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1
51 changed files with 326 additions and 168 deletions

View file

@ -13,6 +13,7 @@ import { SavedMessage } from "src/data/entities/SavedMessage";
import { renderTemplate, TemplateParseError } from "src/templateFormatter";
import { logger } from "src/logger";
import moment from "moment-timezone";
import { inGuildTz } from "../../../utils/timezones";
export async function getLogMessage(
pluginData: PluginData<LogsPluginType>,
@ -87,7 +88,7 @@ export async function getLogMessage(
const timestampFormat = config.format.timestamp;
if (timestampFormat) {
const timestamp = moment().format(timestampFormat);
const timestamp = inGuildTz(pluginData).format(timestampFormat);
formatted = `\`[${timestamp}]\` ${formatted}`;
}
}