HAHA! so I figured out what was causing the bug.
The bug in the program was that times would have mysterious effects.
after 30 minutes, for example, it would say 1 hour 30 minutes; then at 1:59, it would roll over to 1 hour. and so forth.
this was the cause:
String FormatTimeSpan(TimeSpan formatthis)
{
return String.Format("{0:00}:{1:00}",formatthis.TotalHours,formatthis.Minutes);
}
A short translation: basically, this will give the result of the TimeSpan's TotalHours field and Minutes fields, separated by a colon. And it worked perfectly, actually.
So what was the bug? Well, I thought the TotalHours field was a integer; or, rather, that it would return 0 until the first hour passed, then roll over to 1. Turns out it is a float, and therefore the minute portion was included as a fraction. This resulted in the value being rounded for the format string; so once the minutes passed 30 (.5) it would round up; resulting in all sorts of ridiculousness.
Face-palm worthy, really. All the complicated stuff to look through the various databases, calculate the appropriate date-ranges and cull the right overlaps and so forth works perfectly fine, and then this single line goes and simply formats the otherwise correct value wrongly.
of course my fix was to simply Floor() the TotalHours field. And suddenly all the "calculation issues" went away. VICTORY.