Java: sum and classify time entries per different time intervals
<p>I have a problem that involves some sort of work log and reporting. There is 5 users and I need to obtain their work hours between 2 dates. I can do this and obtain a List of WorkEntry, WorkEntry only has a name, start Date and end Date</p>

<p>My problem is when I want to make the report to show a Monthly sum of the work entries per employee. Lets say I make a report for January to April. What I'm thinking is, for each of the 5 users:</p>

<ul>
<li>take the initial date and 'zero' on the day</li>
<li>create a new date which is one month after the start date (February)</li>
<li>sum app all the WorkEntry times that are between January and February</li>
<li>place the sum in an array</li>
<li>when no more WorkEntry between January and February, increase the dates by one month</li>
<li>increase the array counter and repeat</li>
</ul>

<p>I'm finding myself using like 3 calendars, and my last step does not work properly if there is a month without work logs, can I get some ideas?</p>
