Fix issues with contextual menu in calendars

Creating an event or a task using the contextual menu will now consider
the day and hour of the menu position (fixes #2557).
The next/previous day/month menu options have been fixed.
The menu will now disappear when clicking outside the contextual menu on
the calendar area.