mpxj icon indicating copy to clipboard operation
mpxj copied to clipboard

Is ProjectCalendar.getDate(startDate, duration, returnNextWorkStart) working correctly?

Open andrebaaij opened this issue 10 years ago • 2 comments

I was wondering if the function ProjectCalendar.getDate(Date startDate, Duration duration, boolean returnNextWorkStart) is working correctly. The description states:

It takes account of working hours in each day, non working and calendar exceptions.

I would have thought that the function would not allocate hours for days with DayType.NON_WORKING, it however does allocate hours on non working days in the tests I performed.

andrebaaij avatar Oct 21 '15 21:10 andrebaaij

Can you provide a simple test case? Thanks!

joniles avatar Oct 22 '15 08:10 joniles

Here is an attached example where the wednesday is not a working day. here is some pseudo code as an example:

result = ProjectCalendar.getDate(any tuesday after working hours ex. 8:00 pm, 1h, false)

expected result would be the next thursday 8:00 am, as the wednesday is a non working day.

actual result is wednesday morning 8:00 am.

Some details might be off but I hope my point comes across. if not I can write a working example in C#.

andrebaaij avatar Oct 26 '15 21:10 andrebaaij