Exemplo n.º 1
0
        public string MiniCalendar()
        {
            int year  = 0;
            int month = 0;

            CalendarFunctions.GetMonth(ref year, ref month);

            return(MiniCalendar(year, month));
        }
        public override string RenderData()
        {
            int year  = 0;
            int month = 0;

            CalendarFunctions.GetMonth(ref year, ref month);

            DateTime currentMonth  = new DateTime(year, month, 1);
            DateTime previousMonth = currentMonth.AddMonths(-1);
            DateTime nextMonth     = currentMonth.AddMonths(1);

            string ret = String.Format("<a class=\"previousMonth\" href=\"?d={0}{1}\">{2}</a>", previousMonth.Year.ToString().PadLeft(4, '0'), previousMonth.Month.ToString().PadLeft(2, '0'), previousMonth.ToString("MMMM yyyy"));

            ret += String.Format("<a class=\"nextMonth\" href=\"?d={0}{1}\">{2}</a>", nextMonth.Year.ToString().PadLeft(4, '0'), nextMonth.Month.ToString().PadLeft(2, '0'), nextMonth.ToString("MMMM yyyy"));
            ret += CalendarFunctions.BuildCalendar(true, year, month, null);

            return(ret);
        }
Exemplo n.º 3
0
        public string MultipleMiniCalendars(int count, bool startWithNextMonth)
        {
            int year  = 0;
            int month = 0;

            CalendarFunctions.GetMonth(ref year, ref month);

            if (startWithNextMonth)
            {
                CalendarFunctions.IncrementMonth(ref year, ref month);
            }

            string calendars = "";

            for (int i = 0; i < count; ++i)
            {
                calendars += MiniCalendar(year, month);
                CalendarFunctions.IncrementMonth(ref year, ref month);
            }

            return(calendars);
        }