Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-48651

Calendar end of month miscalculated when Daylight Savings changes

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • None
    • 2.7.3
    • Calendar
    • None
    • MOODLE_27_STABLE

      The mini calendar does not correctly display for the months in which Daylight Savings changes.

      For example, for the month of November, the calendar will start at Nov 1, 00:00:00 local time and end Nov 30, 22:59:59 local time.

      This is caused by the display->tend calculation which starts with the display->tstart time and adds the number of seconds for the number of calendar days in the month. However, when DST changes in a month, the number of seconds in that month will be off by an hour either direction.

      The mini calendar instance of the miscalculation points to a larger problem in moodle for calculating the end of a month. For example, I see this type of logic in calendar\export_execute.php among others.

      Succinctly, if the end of a day, month, year is calculated based on the standard length of a day (usually using DAYSECS), then end of the period will be incorrect for any period including a Daylight Savings change.

            Unassigned Unassigned
            pjking07 PJ King
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.