Esempio n. 1
0
        public IEnumerable <ReportItem <TValue> > GenerateByPersianDay <TValue>(System.DateTime?from = null, System.DateTime?to = null)
        {
            System.DateTime f = from ?? _MIN, t = to ?? _MAX;

            while (f < t)
            {
                var pf = f.ToPersianDate();
                yield return(new ReportItem <TValue>
                {
                    Key = pf.Year * 10000 + pf.Month * 100 + pf.Day,
                    Day = pf.Day,
                    DayName = DateUtility.GetPersianDayName(_pc.GetDayOfWeek(f)),
                    Month = pf.Month,
                    MonthName = DateUtility.GetPersianMonthName(pf.Month),
                    Year = pf.Year,
                });

                f = f.AddDays(1);
            }
        }