Пример #1
0
 public PrintMonthlyView(ISessionContext sessionContext, CalendarAdapterBase calendarAdapter, bool workingDayOnly) : base(sessionContext, calendarAdapter)
 {
     this.showWeekNumbers = sessionContext.ShowWeekNumbers;
     this.calendar        = new GregorianCalendar();
     this.daysFormat      = (DateTimeUtilities.GetDaysFormat(sessionContext.DateFormat) ?? "%d");
     this.firstDayFormat  = "MMM %d";
     if (CalendarUtilities.FullMonthNameRequired(sessionContext.UserCulture))
     {
         this.firstDayFormat = string.Format("MMMM {0}", this.daysFormat);
     }
     this.workingDayOnly = workingDayOnly;
     this.sessionContext = sessionContext;
     this.workDays       = PrintMonthlyView.GetWorkingDays(calendarAdapter, sessionContext);
 }
Пример #2
0
        public static ExDateTime[] GetEffectiveDates(CalendarAdapterBase calendarAdapter, ISessionContext sessionContext, bool workingDayOnly)
        {
            List <ExDateTime> list = new List <ExDateTime>();
            bool flag        = false;
            int  workingDays = PrintMonthlyView.GetWorkingDays(calendarAdapter, sessionContext);

            for (int i = 0; i < calendarAdapter.DateRanges.Length; i++)
            {
                ExDateTime start = calendarAdapter.DateRanges[i].Start;
                if (start.Day == 1)
                {
                    if (flag)
                    {
                        break;
                    }
                    flag = true;
                }
                if (flag && PrintMonthlyView.ShouldRenderDay(start, workingDays, workingDayOnly))
                {
                    list.Add(start);
                }
            }
            return(list.ToArray());
        }