Is there a bug in Weekend Calendar?


#1

Hello,

I’m just playing around with Strata dates and Calendars and I have this example which I’m pretty sure the result is wrong. The Weekend calendar seems to adjust this date to a Weekend date. (SATURDAY).

	LocalDate SAT_2014 = LocalDate.of(2014, 7, 12);
	DayOfWeek day1 = SAT_2014.getDayOfWeek();
	
	LocalDate dtAdjDate = com.opengamma.strata.basics.date.HolidayCalendars.SAT_SUN.shift(SAT_2014, 5);
	DayOfWeek day2 = dtAdjDate.getDayOfWeek();

Am I reading this right?

Shifting by 4 or 6 days is correct, but not 5 days.

Best,
Toyin Akin.


#2

Yes, it is a bug. It happens because the base date is not a business day. We’ll get it fixed, thanks.
Stephen


#3

https://github.com/OpenGamma/Strata/pull/1594