public DimDate(DateTime d) { var j = new PersianDateTime(d); Date = d; LongDate = d.ToLongDateString(); DayOfWeek = (int)d.DayOfWeek + 1; DayOfWeekName = d.DayOfWeek.ToString(); DayOfMonth = d.Day; DayOfYear = d.DayOfYear; Month = d.Month; MonthName = DateUtility.GetMonthName(d.Month); Year = d.Year; PersianDate = j.ToShortDateString(); PersianDateInt = j.ToShortDateInt(); PersianLongDate = j.ToLongDateString(); PersianDayOfWeek = (int)j.PersianDayOfWeek + 1; PersianDayOfWeekName = j.GetLongDayOfWeekName; PersianDayOfMonth = j.Day; PersianDayOfYear = j.GetDayOfYear; PersianWeekOfMonth = j.GetWeekOfMonth; PersianWeekOfYear = j.GetWeekOfYear; PersianMonth = j.Month; PersianMonthName = j.MonthName; PersianQuarter = DateUtility.GetQuarter(j.Month); PersianQuarterName = DateUtility.GetPersinQuarterName(PersianQuarter); PersianHalfYear = DateUtility.GetHalfYear(j.Month); PersianHalfYearName = DateUtility.GetPersianHalfYearName(PersianHalfYear); PersianYear = j.Year; PersianIsLeapYear = j.IsLeapYear; }
public IEnumerable <ReportItem <TValue> > GenerateByMonth <TValue>(System.DateTime?from = null, System.DateTime?to = null) { System.DateTime f = from ?? _MIN, t = to ?? _MAX; while (f < t) { yield return(new ReportItem <TValue> { Key = f.Year * 100 + f.Month, Month = f.Month, MonthName = DateUtility.GetMonthName(f.Month), Year = f.Year, }); f = f.AddMonths(1); } }