Skip to content

Commit

Permalink
Include last item before today
Browse files Browse the repository at this point in the history
  • Loading branch information
liguori committed Nov 29, 2023
1 parent 5ee8a0f commit 8d4cd90
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Savings.SPA/Pages/Projection.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,11 @@ async Task InitializeList()

if (HidePastItems)
{
materializedMoneyItems= materializedMoneyItems.Where(x=>x.Date>=DateTime.Now.Date).ToArray();
var lastBeforeToday = materializedMoneyItems.LastOrDefault(x => x.Date <= DateTime.Now.Date);
if (lastBeforeToday != null)
{
materializedMoneyItems = materializedMoneyItems[Array.IndexOf(materializedMoneyItems, lastBeforeToday)..];
}
}
}

Expand Down

0 comments on commit 8d4cd90

Please sign in to comment.