only allow polls for raids that did end in the last 7 days or newer

This commit is contained in:
Sarah Faey 2023-11-30 17:17:21 +01:00
parent 2fbbe2f3a7
commit 0ac8fec909

View file

@ -54,7 +54,7 @@
<label> <label>
Raid: Raid:
<InputSelect @bind-Value="_chosenRaid"> <InputSelect @bind-Value="_chosenRaid">
@foreach (Raid raid in _raids.OrderByDescending(r => r.StartTimeUTC)) @foreach (Raid raid in _raids.Where(r => r.StartTimeUTC >= DateTime.UtcNow.AddDays(-7)).OrderByDescending(r => r.StartTimeUTC))
{ {
string name = $"{raid.Title} - {raid.StartTimeUTC.DateTime.ToLongDateString()}"; string name = $"{raid.Title} - {raid.StartTimeUTC.DateTime.ToLongDateString()}";
<option value="@raid.RaidId">@name</option> <option value="@raid.RaidId">@name</option>