public DateTime AddUnitToDate(DateTime date, DateIntervalOptions option, IDateTimeCollection holidays) { DateInterval interval = DateInterval.Year; switch (DatePart) { case DateParts.Month: interval = DateInterval.Month; break; case DateParts.Week: interval = DateInterval.Week; break; case DateParts.Day: interval = DateInterval.Day; break; case DateParts.Hour: interval = DateInterval.Hour; break; case DateParts.Minute: interval = DateInterval.Minute; break; default: // Year break; } return Util.DateAdd(interval, Units, date, option, holidays); }
public DateTime AddUnitToDate(DateTime date, DateIntervalOptions option) { return AddUnitToDate(date, option, null); }