예제 #1
0
        /// <summary>
        /// Add a value of time units to dateTime by calendar information.
        /// </summary>
        /// <param name="dateTime">Calendar time.</param>
        /// <param name="timeUnit">Time unit.</param>
        /// <param name="value">Value.</param>
        /// <returns>Calendar time.</returns>
        public DateTime Add(DateTime dateTime, int value)
        {
            if (value <= 0)
            {
                return(dateTime);
            }
            IEnumerable <ICalendarDay> days = _calendar.GetDays(_countTerm, dateTime, value);

            return(_countTerm.Calculate(days, value));
        }
예제 #2
0
        public DateTime Add(DateTime dateTime, CalendarTimeUnit timeUnit, int value)
        {
            if (value <= 0)
            {
                return(dateTime);
            }
            var           factory           = ClassFactory.Get <CalendarCountTermFactory>();
            BaseCountTerm countTerm         = factory.GetCountTerm(timeUnit);
            IEnumerable <ICalendarDay> days = GetDays(countTerm, dateTime, value);

            return(countTerm.Calculate(days, value));
        }