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

Investigate the way the section dates are calculated (with different TZ they might be wrong)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • 3.11.5
    • Course
    • MOODLE_311_STABLE

      While working on a patch for MDL-73859, we realised there was a pre-existing bug (unrelated to the behat test) that can be reproduced consistently under the following circumstances:

      • Running the "Highlight first week", changing "##yesterday##" to "##today##" and
      • The day for the current date wherever you run the behat test and Perth time is different (for instance, all the jobs launched after 17:00 EU (00:00 AU) will fail).

      The calculation of the "This week" badge is done in the get_section_dates() method in course/format/weeks/lib.php, and the calculation of the start course date is tricky (because it also introduces the user dates to the equation).

      Ideally, we should really calculate them properly, say:

      • week one begins on course->starttime and ends on +7 days.
      • week2 begins on +7 days and ends on +7 days
      • ...

      And then, just see in which of the intervales the current unix-time falls.

      This issue is to investigate the bug and check if it's possible to avoid mixing timezones.

        1. bug-date.png
          35 kB
          Peter Reisinger

            Unassigned Unassigned
            sarjona Sara Arjona (@sarjona)
            Votes:
            4 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:

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