AddMonth() 공개 정적인 메소드

public static AddMonth ( YearMonth startMonth, int count, int &year, YearMonth &month ) : void
startMonth YearMonth
count int
year int
month YearMonth
리턴 void
        }                                                                      // MonthTimeRange

        // ----------------------------------------------------------------------
        protected MonthTimeRange(int startYear, YearMonth startMonth, int monthCount, ITimeCalendar calendar) :
            base(GetPeriodOf(calendar, startYear, startMonth, monthCount), calendar)
        {
            this.startYear  = startYear;
            this.startMonth = startMonth;
            this.monthCount = monthCount;
            TimeTool.AddMonth(startYear, startMonth, monthCount - 1, out endYear, out endMonth);
        }     // MonthTimeRange
예제 #2
0
        }         // Months

        // ----------------------------------------------------------------------
        public ITimePeriodCollection GetMonths()
        {
            TimePeriodCollection months = new TimePeriodCollection();

            for (int i = 0; i < MonthCount; i++)
            {
                int       year;
                YearMonth month;
                TimeTool.AddMonth(StartYear, StartMonth, i, out year, out month);
                months.Add(new Month(year, month, Calendar));
            }
            return(months);
        }         // GetMonths
예제 #3
0
        }                                                          // Months

        // ----------------------------------------------------------------------
        public ITimePeriodCollection GetMonths()
        {
            TimePeriodCollection months = new TimePeriodCollection();

            foreach (var i in Enumerable.Range(0, MonthCount))
            {
                int       year;
                YearMonth month;
                TimeTool.AddMonth(StartYear, StartMonth, i, out year, out month);
                months.Add(new Month(year, month, Calendar));
            }
            return(months);
        } // GetMonths
예제 #4
0
        } // GetQuarters

        // ----------------------------------------------------------------------
        public ITimePeriodCollection GetMonths()
        {
            TimePeriodCollection months = new TimePeriodCollection();

            foreach (var i in Enumerable.Range(0, yearCount))
            {
                foreach (var month in Enumerable.Range(0, TimeSpec.MonthsPerYear))
                {
                    int       year;
                    YearMonth yearMonth;
                    TimeTool.AddMonth(startYear, YearBaseMonth, (i * TimeSpec.MonthsPerYear) + month, out year, out yearMonth);
                    months.Add(new Month(year, yearMonth, Calendar));
                }
            }
            return(months);
        } // GetMonths
예제 #5
0
        }         // EndQuarterOfYearName

        // ----------------------------------------------------------------------
        public ITimePeriodCollection GetMonths()
        {
            TimePeriodCollection months = new TimePeriodCollection();

            for (int i = 0; i < quarterCount; i++)
            {
                for (int month = 0; month < TimeSpec.MonthsPerQuarter; month++)
                {
                    int       year;
                    YearMonth yearMonth;
                    TimeTool.AddMonth(startYear, YearBaseMonth, (i * TimeSpec.MonthsPerQuarter) + month, out year, out yearMonth);
                    months.Add(new Month(year, yearMonth, Calendar));
                }
            }
            return(months);
        }         // GetMonths
예제 #6
0
        }         // GetQuarters

        // ----------------------------------------------------------------------
        public ITimePeriodCollection GetMonths()
        {
            TimePeriodCollection months     = new TimePeriodCollection();
            YearMonth            startMonth = YearBaseMonth;

            if (StartHalfyear == YearHalfyear.Second)
            {
                int year;
                TimeTool.AddMonth(startYear, startMonth, TimeSpec.MonthsPerHalfyear, out year, out startMonth);
            }
            for (int i = 0; i < halfyearCount; i++)
            {
                for (int month = 0; month < TimeSpec.MonthsPerHalfyear; month++)
                {
                    int       year;
                    YearMonth yearMonth;
                    TimeTool.AddMonth(startYear, startMonth, (i * TimeSpec.MonthsPerHalfyear) + month, out year, out yearMonth);
                    months.Add(new Month(year, yearMonth, Calendar));
                }
            }
            return(months);
        }         // GetMonths
        } // GetStartOfMonth

        // ----------------------------------------------------------------------
        private static TimeRange GetPeriodOf(ITimeCalendar calendar, int startYear, YearMonth startMonth, int monthCount)
        {
            if (monthCount < 1)
            {
                throw new ArgumentOutOfRangeException("monthCount");
            }

            DateTime start = GetStartOfMonth(calendar, startYear, startMonth);
            DateTime end;

            if (calendar.YearType == YearType.FiscalYear)
            {
                int       endYear;
                YearMonth endMonth;
                TimeTool.AddMonth(startYear, startMonth, monthCount, out endYear, out endMonth);
                end = GetStartOfMonth(calendar, endYear, endMonth);
            }
            else
            {
                end = start.AddMonths(monthCount);
            }
            return(new TimeRange(start, end));
        } // GetPeriodOf