System.Globalization.Calendar.AddMonths C# (CSharp) 메소드

AddMonths() 공개 추상적인 메소드

public abstract AddMonths ( DateTime time, int months ) : DateTime
time DateTime
months int
리턴 DateTime
        public abstract DateTime AddMonths(DateTime time, int months);

Usage Example

예제 #1
0
        //Creates a title block. No customization is offered, if that's needed then specify the header template.
        Control CreateStaticTitle(DateTime visibleDate, System.Globalization.Calendar threadCalendar)
        {
            //Create a new table for the header controls

            Table titleTable = new Table();

            titleTable.GridLines   = GridLines.None;
            titleTable.Width       = Unit.Percentage(100);
            titleTable.CellSpacing = 0;

            TableRow titleTableRow = new TableRow();

            titleTable.Rows.Add(titleTableRow);

            TableCell PrevCell = new TableCell();

            titleTableRow.Cells.Add(PrevCell);
            PrevCell.ApplyStyle(nextPrevStyle);
            Button PrevBtn = new Button();

            PrevBtn.CssClass    = "buttonlink";
            PrevBtn.Text        = "< " + threadCalendar.AddMonths(visibleDate, -1).ToString("MMMM");
            PrevBtn.CommandName = COMMAND_PREVMONTH;
            PrevCell.Controls.Add(PrevBtn);

            TableCell MonthCell = new TableCell();

            titleTableRow.Cells.Add(MonthCell);
            MonthCell.ApplyStyle(titleStyle);
            MonthCell.Text = visibleDate.ToString("MMMM yyyy");

            TableCell NextCell = new TableCell();

            titleTableRow.Cells.Add(NextCell);
            NextCell.ApplyStyle(nextPrevStyle);
            Button NextBtn = new Button();

            NextBtn.CssClass    = "buttonlink";
            NextBtn.Text        = threadCalendar.AddMonths(visibleDate, +1).ToString("MMMM") + " >";
            NextBtn.CommandName = COMMAND_NEXTMONTH;
            NextCell.Controls.Add(NextBtn);

            return(titleTable);
        }
All Usage Examples Of System.Globalization.Calendar::AddMonths