private void changeDate(int newIndex, section section)
        {
            String[] sections = lastDateTemplate.Split(new char[] { '/', '-', '.' });

            switch (sections[(int)section])
            {
            case "M":
            case "MM":
                DisplayedDate = DisplayedDate.AddMonths((newIndex + 1) - DisplayedDate.Month);
                break;

            case "d":
            case "dd":
                DisplayedDate = DisplayedDate.AddDays((newIndex + 1) - DisplayedDate.Day);
                break;

            case "yyyy":
            case "yy":
                DisplayedDate = DisplayedDate.AddYears((newIndex + MinYear) - DisplayedDate.Year);
                break;

            default:
                break;
            }
        }
Beispiel #2
0
 private void buttonPrevMonth_Click(object sender, EventArgs e)
 {
     DisplayedDate   = DisplayedDate.AddMonths(-1);
     labelMonth.Text = string.Format("{0:MMMM}, {1:yyyy}", DisplayedDate, DisplayedDate);
     ClearAndReload();
 }
Beispiel #3
0
 private void buttonNextMonth_Click(object sender, EventArgs e)
 {
     DisplayedDate   = DisplayedDate.AddMonths(1);
     labelMonth.Text = $@"{DisplayedDate:MMMM}, {DisplayedDate:yyyy}";
     ClearAndReload();
 }