diff --git a/Plan/src/main/java/com/djrapitops/plan/utilities/FormatUtils.java b/Plan/src/main/java/com/djrapitops/plan/utilities/FormatUtils.java index 1485785e8..d63beb564 100644 --- a/Plan/src/main/java/com/djrapitops/plan/utilities/FormatUtils.java +++ b/Plan/src/main/java/com/djrapitops/plan/utilities/FormatUtils.java @@ -47,6 +47,16 @@ public class FormatUtils { return formatMilliseconds(Math.abs(after - before)); } + public static String formatTimeStampDay(long epochMs) { + String format = "MMMMM d"; + + if (Settings.FORMAT_DATE_RECENT_DAYS.isTrue()) { + format = replaceRecentDays(epochMs, format, "MMMMM"); + } + + return format(epochMs, format); + } + public static String formatTimeStampClock(long epochMs) { String format = Settings.FORMAT_DATE_CLOCK.toString(); @@ -71,9 +81,12 @@ public class FormatUtils { } private static String replaceRecentDays(long epochMs, String format) { + return replaceRecentDays(epochMs, format, Settings.FORMAT_DATE_RECENT_DAYS_PATTERN.toString()); + } + + private static String replaceRecentDays(long epochMs, String format, String pattern) { long now = MiscUtils.getTime(); - String pattern = Settings.FORMAT_DATE_RECENT_DAYS_PATTERN.toString(); long fromStartOfDay = now % TimeAmount.DAY.ms(); if (epochMs > now - fromStartOfDay) { format = format.replace(pattern, "'Today'"); diff --git a/Plan/src/main/java/com/djrapitops/plan/utilities/html/graphs/ActivityStackGraph.java b/Plan/src/main/java/com/djrapitops/plan/utilities/html/graphs/ActivityStackGraph.java index 734505e5e..70b43d280 100644 --- a/Plan/src/main/java/com/djrapitops/plan/utilities/html/graphs/ActivityStackGraph.java +++ b/Plan/src/main/java/com/djrapitops/plan/utilities/html/graphs/ActivityStackGraph.java @@ -28,7 +28,7 @@ public class ActivityStackGraph extends AbstractStackGraph { private static String[] getLabels(NavigableSet dates) { return dates.stream() - .map(FormatUtils::formatTimeStampYear) + .map(FormatUtils::formatTimeStampDay) .toArray(String[]::new); }