From d22ade87d7bc559ce86fc55e2631ebb2686c63c0 Mon Sep 17 00:00:00 2001 From: Lexon <44340857+L-e-x-o-n@users.noreply.github.com> Date: Tue, 12 Mar 2024 21:09:15 +0100 Subject: [PATCH] Use relative timestamps for moderation bot posts --- lib/teiserver/helpers/timex_helper.ex | 5 +++++ lib/teiserver/moderation/libs/action_lib.ex | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/teiserver/helpers/timex_helper.ex b/lib/teiserver/helpers/timex_helper.ex index 9bf206f41..d5cda1bab 100644 --- a/lib/teiserver/helpers/timex_helper.ex +++ b/lib/teiserver/helpers/timex_helper.ex @@ -16,6 +16,11 @@ defmodule Teiserver.Helper.TimexHelper do end end + @spec date_to_discord_str(DateTime.t()) :: String.t() + def date_to_discord_str(the_time) do + "" + end + @spec date_to_str(DateTime.t()) :: String.t() @spec date_to_str(DateTime.t(), list) :: String.t() def date_to_str(the_time), do: date_to_str(the_time, []) diff --git a/lib/teiserver/moderation/libs/action_lib.ex b/lib/teiserver/moderation/libs/action_lib.ex index 7a4bcbf13..30633f93f 100644 --- a/lib/teiserver/moderation/libs/action_lib.ex +++ b/lib/teiserver/moderation/libs/action_lib.ex @@ -220,7 +220,7 @@ defmodule Teiserver.Moderation.ActionLib do if action do until = if action.expires do - "Until: " <> TimexHelper.date_to_str(action.expires, format: :ymd_hms) <> " (UTC)" + "Until: " <> TimexHelper.date_to_discord_str(action.expires) else "Permanent" end