Пример #1
0
        public override DateRangeParameter GetDateRange()
        {
            var now        = TimeService.CurrentDateTime.Date;
            var difference = (now.DayOfWeek - beginningOfWeek.ToDayOfWeekEnum() + 7) % 7;
            var start      = now.AddDays(-(difference + 7));
            var end        = start.AddDays(6);

            return(DateRangeParameter.WithDates(start, end));
        }
Пример #2
0
        private void addDaysFromPreviousMonth()
        {
            var firstDayOfMonth = CalendarMonth.DayOfWeek(1);

            if (firstDayOfMonth == beginningOfWeek.ToDayOfWeekEnum())
            {
                return;
            }

            var previousMonth       = CalendarMonth.Previous();
            var daysInPreviousMonth = previousMonth.DaysInMonth;
            var daysToAdd           = ((int)firstDayOfMonth - (int)beginningOfWeek.ToDayOfWeekEnum() + 7) % 7;

            for (int i = daysToAdd - 1; i >= 0; i--)
            {
                addDay(daysInPreviousMonth - i, previousMonth, false);
            }
        }
Пример #3
0
        public override ReportsDateRangeParameter GetDateRange()
        {
            var now        = TimeService.CurrentDateTime.Date;
            var difference = (now.DayOfWeek - beginningOfWeek.ToDayOfWeekEnum() + 7) % 7;
            var start      = now.AddDays(-difference);
            var end        = start.AddDays(6);

            return(ReportsDateRangeParameter
                   .WithDates(start, end)
                   .WithSource(ReportsSource.ShortcutThisWeek));
        }