I'm using .net razor to display the date of football matches, I'm trying to only display the matches that are going to happen within the next week. The problem is that my date is currently a String, it looks like: "Saturday 23rd January 2016".
@foreach (var dateItem in Model.Select(i => i.date).Distinct().ToList())
{
DateTime dt = DateTime.ParseExact(dateItem, "D", null);
<tr>
@if ((DateTime.Now - dt).TotalDays < 5)
{
<tr>
<th>
@Html.DisplayFor(modelItem => dateItem)
</th>
</tr>
<tr>
<th>
This is what I've tried so far with no luck