MVC Editor Templates for Date Ranges
Date Range VM
public class DateRangeVM
{
public DateTime? DateFrom { get; set; }
public DateTime? DateTo { get; set; }
}
Editor Templates
@model DateRangeVM
<div class="d-flex justify-content-between align-items-center">
@Html.TextBoxFor(x => x.DateFrom, new { @class = "form-control", @type = "date" })
<label class="mx-1">to</label>
@Html.TextBoxFor(x => x.DateTo, new { @class = "form-control", @type = "date" })
</div>