Пример #1
0
        }         // Format

        // ----------------------------------------------------------------------
        private static int GetYearOf(DateTime moment)
        {
            int year;

            BroadcastCalendarTool.GetYearOf(moment, out year);
            return(year);
        }         // GetYaarOf
Пример #2
0
        }         // GetNextMonth

        // ----------------------------------------------------------------------
        public BroadcastMonth AddMonths(int months)
        {
            int       targetYear;
            YearMonth targetMonth;

            BroadcastCalendarTool.AddMonths(Year, Month, months, out targetYear, out targetMonth);
            return(new BroadcastMonth(targetYear, targetMonth, Calendar));
        }         // AddMonths
Пример #3
0
        }         // GetYaarOf

        // ----------------------------------------------------------------------
        private static YearMonth GetMonthOf(DateTime moment)
        {
            int       year;
            YearMonth month;

            BroadcastCalendarTool.GetMonthOf(moment, out year, out month);
            return(month);
        }         // GetMonthOf
Пример #4
0
        }         // GetYearOf

        // ----------------------------------------------------------------------
        private static int GetWeekOf(DateTime moment)
        {
            int year;
            int week;

            BroadcastCalendarTool.GetWeekOf(moment, out year, out week);
            return(week);
        }         // GetWeekOf
Пример #5
0
        }         // Year

        // ----------------------------------------------------------------------
        public ITimePeriodCollection GetWeeks()
        {
            TimePeriodCollection weeks = new TimePeriodCollection();
            int weekCount = BroadcastCalendarTool.GetWeeksOfYear(year);

            for (int week = 1; week <= weekCount; week++)
            {
                weeks.Add(new BroadcastWeek(year, week));
            }
            return(weeks);
        }         // GetWeeks
Пример #6
0
        }         // GetMonthOf

        // ----------------------------------------------------------------------
        private static ITimeRange GetPeriodOf(int year, YearMonth month)
        {
            DateTime start = BroadcastCalendarTool.GetStartOfMonth(year, month);

            if (month == YearMonth.December)
            {
                year++;
                month = YearMonth.January;
            }
            else
            {
                month++;
            }
            DateTime end = BroadcastCalendarTool.GetStartOfMonth(year, month);

            return(new CalendarTimeRange(start, end));
        }         // GetPeriodOf
Пример #7
0
        }         // GetYearOf

        // ----------------------------------------------------------------------
        private static ITimeRange GetPeriodOf(int year)
        {
            return(new CalendarTimeRange(
                       BroadcastCalendarTool.GetStartOfYear(year),
                       BroadcastCalendarTool.GetStartOfYear(year + 1)));
        }         // GetPeriodOf
Пример #8
0
        }         // GetWeekOf

        // ----------------------------------------------------------------------
        private static ITimeRange GetPeriodOf(int year, int week)
        {
            DateTime start = BroadcastCalendarTool.GetStartOfWeek(year, week);

            return(new CalendarTimeRange(start, start.AddDays(TimeSpec.DaysPerWeek)));
        }         // GetPeriodOf