Fixed bug identified in #3589 for the v4.0 branch.
Merge pull request #3633 from thomasgohard/fix-events-calendar-offby1

Fixed bug identified in #3589 for the v4.0 branch