public JsonResult ValidateDate(DateViewModel viewModel) { try { DateMapper.Map(viewModel); return Json(true); } catch (Exception) { return Json(false); } }
public static DateTime Map(DateViewModel viewModel) { return new DateTime(viewModel.Year, viewModel.Month, viewModel.Day); }