Edit.cshtml
@Html.LabelFor(model => model.StartDate, htmlAttributes: new { @class = "control-label col-md-2" })
@(Html.DevExtreme().DateBoxFor(m => m.StartDate)
.ID("startDate")
.DisplayFormat(System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat.ShortDatePattern)
.Placeholder(System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat.ShortDatePattern)
.ShowClearButton(true)
.InvalidDateMessage("The date must have the following format: " + System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat.ShortDatePattern))
@Html.ValidationMessageFor(m => m.StartDate, null, new { @class = "text-danger" })
@Html.LabelFor(model => model.EndDate, htmlAttributes: new { @class = "control-label col-md-2" })
@(Html.DevExtreme().DateBoxFor(m => m.EndDate)
.ID("endDate")
.DisplayFormat(System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat.ShortDatePattern)
.Placeholder(System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat.ShortDatePattern)
.ShowClearButton(true)
.InvalidDateMessage("The date must have the following format: " + System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat.ShortDatePattern)
.OnValueChanged("endDateChange"))
Model
[DisplayName("Start date")]
[DataType(DataType.Date)]
[DisplayFormat(DataFormatString = "{0:MM/dd/yyyy}", ApplyFormatInEditMode = true)]
[Required(ErrorMessage = "Start date is required")]
public DateTime? StartDate { get; set; }
[DisplayName("End date")]
[DisplayFormat(DataFormatString = "{0:d}", ApplyFormatInEditMode = true)]
public DateTime? EndDate { get; set; }

Jefferson S. MottaPosted Apr 30, 2020, 3:34 PM