diff --git a/Plugins/Stats/Dtos/ChatSearchQuery.cs b/Plugins/Stats/Dtos/ChatSearchQuery.cs
index f58f1145f..443389079 100644
--- a/Plugins/Stats/Dtos/ChatSearchQuery.cs
+++ b/Plugins/Stats/Dtos/ChatSearchQuery.cs
@@ -28,18 +28,19 @@ namespace Stats.Dtos
///
/// The time associated with SentAfter date
///
- public string SentAfterTime { get; set; } = "00:00";
+ public string SentAfterTime { get; set; }
- public DateTime? SentAfterDateTime => SentAfter?.Add(TimeSpan.Parse(SentAfterTime));
+ public DateTime? SentAfterDateTime => SentAfter?.Add(string.IsNullOrEmpty(SentAfterTime) ? TimeSpan.Zero : TimeSpan.Parse(SentAfterTime));
///
/// only look for messages sent before this date0
///
public DateTime SentBefore { get; set; } = DateTime.UtcNow.Date;
- public string SentBeforeTime { get; set; } = DateTime.UtcNow.ToString("HH:mm");
+ public string SentBeforeTime { get; set; }
- public DateTime? SentBeforeDateTime => SentBefore.Add(TimeSpan.Parse(SentBeforeTime));
+ public DateTime? SentBeforeDateTime =>
+ SentBefore.Add(string.IsNullOrEmpty(SentBeforeTime) ? TimeSpan.Zero : TimeSpan.Parse(SentBeforeTime));
public bool IsExactMatch { get; set; }
diff --git a/Plugins/Stats/Plugin.cs b/Plugins/Stats/Plugin.cs
index ee8ccc7da..fabc6da29 100644
--- a/Plugins/Stats/Plugin.cs
+++ b/Plugins/Stats/Plugin.cs
@@ -469,6 +469,8 @@ public class Plugin : IPluginV2
ClientId = request.ClientId,
Before = request.Before,
SentBefore = request.Before ?? DateTime.UtcNow,
+ SentAfter = request.After,
+ After = request.After,
Count = request.Count,
IsProfileMeta = true
};