Exemplo n.º 1
0
        } // Format

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

            BroadcastCalendarTool.GetYearOf(moment, out year);
            return(year);
        } // GetYaarOf
Exemplo n.º 2
0
        } // GetYaarOf

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

            BroadcastCalendarTool.GetMonthOf(moment, out year, out month);
            return(month);
        } // GetMonthOf
Exemplo n.º 3
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
Exemplo n.º 4
0
        } // GetYearOf

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

            BroadcastCalendarTool.GetWeekOf(moment, out year, out week);
            return(week);
        } // GetWeekOf
Exemplo n.º 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
Exemplo n.º 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
Exemplo n.º 7
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
Exemplo n.º 8
0
        } // GetYearOf

        // ----------------------------------------------------------------------
        private static ITimeRange GetPeriodOf(int year)
        {
            return(new CalendarTimeRange(
                       BroadcastCalendarTool.GetStartOfYear(year),
                       BroadcastCalendarTool.GetStartOfYear(year + 1)));
        } // GetPeriodOf