/// <summary> /// Creates an instance of MonthSlideItemVm starting at the given DateTime /// </summary> /// <remarks>This constructor adds the number of days in month to its ref parameter</remarks> /// <param name="dt">Pass the start of the month</param> /// <param name="daysFromStartOfYear">Pass 0 for first month, so the value can be accumulated over each month</param> public MonthSlideItemVm(DateTime dt, ref int daysFromStartOfYear) { Data = dt; NumOfDays = dt.GetPersianMonthDays(); DaysFromStartOfYear = daysFromStartOfYear; daysFromStartOfYear += NumOfDays; ColumnIndex = (int)dt.GetPersianMonth() - 1; Text = string.Format("{0}/{1}", dt.GetPersianYear(), dt.GetPersianMonth()); }
/// <summary> /// Creates an instance of HourSlideItemVm starting at the given DateTime /// </summary> /// <param name="dt">Pass the start of the hour</param> public HourSlideItemVm(DateTime dt) { Data = dt; ColumnIndex = (dt.GetPersianDayOfYear() - 1) * 24 + dt.Hour; Text = string.Format("{0:D2}:00",dt.Hour); DateText = string.Format("{0:D2}/{1:D2}", (int)dt.GetPersianMonth(), dt.GetPersianDayOfMonth()); }
public BarSlideItemVm(DateTime dt) { Data = dt; Header = string.Format("{0}/{1}", dt.GetPersianYear(), dt.GetPersianMonth()); }