10 May
2014
10 May
'14
3:14 p.m.
I need to find a day that stands 30 working days from a specific date, ignoring holidays. Currently I am doing it like this: boost::gregorian::date lastdate; int maxdays(30); for (int i = maxdays; i != 0; --i) { // skip weekends gregorian_calendar::day_of_week_type dow = lastdate.day_of_week(); while ( (dow == Sunday ) || (dow == Saturday) ) { lastdate -= boost::gregorian::date_duration(1); dow = lastdate.day_of_week(); } lastdate -= boost::gregorian::date_duration(1); } I did not find the iterator that can do it cleaner, but may be there is one? Thanks.