Fixed tooltip and duration in agenda.

The tooltip did not show the end of an agenda item, but of the hole event.

If a item was closed, it was not used to calculate the end of the event.

Fixed #833