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
Merge pull request #836 from ostcar/issue-833

Fixed tooltip and duration in agenda.