From c95e03887bd1401d9e9a330915d526bf7be6efc2 Mon Sep 17 00:00:00 2001 From: Skezza <36114463+SkezzaB@users.noreply.github.com> Date: Sat, 15 Aug 2020 12:42:21 +0100 Subject: [PATCH] Fixed Auto Clear Date --- .../helpbot/bot/command/impl/stats/PlotCommand.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/diamondfire/helpbot/bot/command/impl/stats/PlotCommand.java b/src/main/java/com/diamondfire/helpbot/bot/command/impl/stats/PlotCommand.java index 785df3ea..97bd644c 100644 --- a/src/main/java/com/diamondfire/helpbot/bot/command/impl/stats/PlotCommand.java +++ b/src/main/java/com/diamondfire/helpbot/bot/command/impl/stats/PlotCommand.java @@ -103,8 +103,10 @@ public void run(CommandEvent event) { } int weeksTillClear = resultTablePlot.getInt("immunity_level"); - embed.addField("Auto Clear Date", StringUtil.formatDate(new Date(LocalDateTime.now().plus(weeksTillClear, ChronoUnit.WEEKS).toInstant(ZoneOffset.UTC).toEpochMilli())) + String.format(" (%s weeks)", weeksTillClear), true); - embed.addField("Last Active Date", StringUtil.formatDate(resultTablePlot.getDate("active_time")), true); + Date activeTime = resultTablePlot.getDate("active_time") + + embed.addField("Auto Clear Date", StringUtil.formatDate(new Date(activeTime.plus(weeksTillClear, ChronoUnit.WEEKS).toInstant(ZoneOffset.UTC).toEpochMilli())) + String.format(" (%s weeks)", weeksTillClear), true); + embed.addField("Last Active Date", StringUtil.formatDate(activeTime), true); embed.addField("Whitelisted", (resultTablePlot.getInt("whitelist") == 1) + "", true); embed.addField("Player Count", StringUtil.formatNumber(resultTablePlot.getInt("player_count")), true); embed.addField("Current Votes", StringUtil.formatNumber(resultTablePlot.getInt("votes")), true); @@ -131,4 +133,4 @@ public void run(CommandEvent event) { }).execute(); } -} \ No newline at end of file +}