public ActionResult UiDateTimeEditorTemplatesTest(UiDateTimeEditorTemplatesTestModel model) { if (!ModelState.IsValid) { return View(model); } return View(model); }
public ActionResult UiDateTimeEditorTemplatesTest() { ViewBag.PageTitle = "C# MVC DateTime Conversion | UiDateTimeModel Editor Templates"; UiDateTimeEditorTemplatesTestModel model = null; try { var timeZone = TimeZoneInfo.FindSystemTimeZoneById("Eastern Standard Time").StandardName; model = new UiDateTimeEditorTemplatesTestModel { RangeDateToDate = new UiDateTimeRangeModel(timeZone) { }, RangeTimeToTime = new UiDateTimeRangeModel(timeZone) { }, RangeDateTimeToTime = new UiDateTimeRangeModel(timeZone) { }, RangeDateTimeToDateTime = new UiDateTimeRangeModel(timeZone) { } }; } catch (Exception e) { throw new Exception("UiDateTimeRangeModel Error: " + e.Message); } return View(model); }