fix calendarDate roundoff (from https://github.com/jonescc)