public IActionResult Index() { CurrentMonthDto currentMonthData = service.GetCurrentMonthData(); ViewBag.Months = Months; return(View(currentMonthData)); }
public CurrentMonthDto GetCurrentMonthData() { var days = DateTime.DaysInMonth(DateTime.Now.Year, DateTime.Now.Month); var result = new CurrentMonthDto() { Month = DateTime.Now.ToString("MMMM"), Days = days, FirstDayOfMonth = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1).DayOfWeek.ToString(), Dates = FillDates(days) }; return(result); }