Possible Bug in Calendar::adjust

Posted by Chris Audley-3 on
URL: http://quantlib.414.s1.nabble.com/Possible-Bug-in-Calendar-adjust-tp3974.html

I'm just starting to get familiar with QuantLib.  While looking at
Calendar, I've noticed what I believe is an error but I may be wrong.

In adjust with bday convention MonthEndReference, the function
Date::endOfMonth is called with the previous result of moving forward to
the next business day (d1).  I believe this should be called with the
original source date (d).

With the current code, if the original date (d) had been 7/31/2005, d1
would be 8/1/2005.  Following this logic, the result date (d1) would be
pushed forward to 8/31/2005.  Without knowing the rules for
MonthEndReference, I'd guess that the desired month end is July
(7/31/2005) giving a final result of 7/29/2005.

If nobody disputes my assertion, I'll submit a bug report.

Cheers
Chris