예제 #1
0
        public IActionResult Index(int year, int month)
        {
            CalendarModel cal = new CalendarModel();

            cal.actualYear      = year;
            cal.actualMonth     = month;
            cal.actualMonthWord = new CultureInfo("en-US").DateTimeFormat.MonthNames[cal.actualMonth - 1];
            cal.daysInMonth     = DateTime.DaysInMonth(year, month);
            cal.setFirstDayOfMonth(year, month);
            char[]   separator = { '-' };
            String[] strlist   = cal.getPreviousMonth().Split(separator);
            int      m         = Int32.Parse(strlist[0]);
            int      y         = Int32.Parse(strlist[1]);

            cal.daysInPreviousMonth = DateTime.DaysInMonth(y, m);
            readFromFile();
            cal.daysWithEvents = new List <string>();
            foreach (SingleEventModel sem in ev)
            {
                cal.daysWithEvents.Add(sem.dateOfSingleEvent);
            }

            return(View(cal));
        }