Esempio n. 1
0
        /// <summary>
        /// Advances the specified date using the underlying calendar locations.
        /// </summary>
        /// <param name="locationsAsArray">The locations range as an array.</param>
        /// <param name="date">The date.</param>
        /// <param name="dayType">The day type: cakendat or business.</param>
        /// <param name="periodInteval">The period inteval.</param>
        /// <param name="businessDayConvention">The business day convention.</param>
        /// <returns>The adjusted date.</returns>
        public DateTime Advance(Excel.Range locationsAsArray, DateTime date, string dayType, string periodInteval, string businessDayConvention)
        {
            List <string> unqVals = DataRangeHelper.StripRange(locationsAsArray);
            var           result  = CalendarService.Advance(unqVals.ToArray(), date, dayType, periodInteval, businessDayConvention);

            return(result);
        }
Esempio n. 2
0
        /// <summary>
        /// Advances the specified date using the underlying calendar locations.
        /// </summary>
        /// <param name="locationsAsArray">The locations range as an array.</param>
        /// <param name="dateRange">The date.</param>
        /// <param name="dayType">The day type: cakendat or business.</param>
        /// <param name="periodInteval">The period inteval.</param>
        /// <param name="businessDayConvention">The business day convention.</param>
        /// <returns>The vertical range of adjusted dates.</returns>
        public object[,] AdvanceDateRange(Excel.Range locationsAsArray, Excel.Range dateRange, string dayType, string periodInteval, string businessDayConvention)
        {
            List <string>   unqVals  = DataRangeHelper.StripRange(locationsAsArray);
            List <DateTime> unqDates = DataRangeHelper.StripDateTimeRange(dateRange);
            List <DateTime> result   = unqDates.Select(element => CalendarService.Advance(unqVals.ToArray(), element, dayType, periodInteval, businessDayConvention)).ToList();
            var             resVals  = new object[result.Count, 1];

            for (int idx = 0; idx < resVals.Length; ++idx)
            {
                resVals[idx, 0] = result[idx];
            }
            return(resVals);
        }