HandCoded.Finance.DateRoll.Preceding C# (CSharp) Method

Preceding() private static method

Adjusts a Date to the preceding business day if it falls on a holiday.
private static Preceding ( Calendar calendar, Date date ) : Date
calendar Calendar The to be used.
date Date The to adjust.
return Date
        private static Date Preceding(Calendar calendar, Date date)
        {
            while (!calendar.IsBusinessDay (date))
                date = date.PlusDays (-1);
            return (date);
        }