Ejemplo n.º 1
0
        public IActionResult Index()
        {
            CurrentMonthDto currentMonthData = service.GetCurrentMonthData();

            ViewBag.Months = Months;
            return(View(currentMonthData));
        }
Ejemplo n.º 2
0
        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);
        }