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

Javascript should use user timezone when calculating midnight for event categorising

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.3
    • Fix Version/s: 3.3
    • Component/s: Blocks
    • Labels:
    • Testing Instructions:
      Hide

      I'm going to assume this testing is being done by someone in the Australia/Perth timezone (UTC+8) and that the computer they are testing on is configured to be in the Australia/Perth timezone.

      Testing setup

      1. Ensure you moodle site has it's timezone set to Australia/Perth
      2. Create 2 users, s1 and s2, and set their timezones to be Australia/Perth and Australia/Melbourne respectively.
      3. Create a course
      4. Create an assignment (assignment 1) with a due date set to 11:30pm today
      5. Create an assignment (assignment 2) with a due date set to 11:30pm 15 days ago (making it overdue)

      Matching timezone test

      1. Log in as s1 (the student set to Australia/Perth)
      2. View your dashboard
      3. You should see an event for assignment 1 due today and it should be under the "today" section in the sort by dates view
      4. You should not see the overdue event for assignment 2 because it's more than 14 days old
      5. Click the sort by courses view
      6. You should see the events categorised the same way

      Special future man test

      1. Log in as s2 (the student set to Australia/Melbourne)
      2. View your dashboard
      3. You should see the event for assignment 1 in the "next 7 days" section (and the date should show as tomorrow) in the sort by dates view
      4. You should see the overdue event for assignment 2 in the "recently overdue" section (and the date should be some time 14 days ago rather than 11:30pm 15 days ago)
      5. Click the sort by courses view
      6. You should see the events categorised the same way

      Repeat the tests on both the boost and clean themes

      Show
      I'm going to assume this testing is being done by someone in the Australia/Perth timezone (UTC+8) and that the computer they are testing on is configured to be in the Australia/Perth timezone. Testing setup Ensure you moodle site has it's timezone set to Australia/Perth Create 2 users, s1 and s2, and set their timezones to be Australia/Perth and Australia/Melbourne respectively. Create a course Create an assignment (assignment 1) with a due date set to 11:30pm today Create an assignment (assignment 2) with a due date set to 11:30pm 15 days ago (making it overdue) Matching timezone test Log in as s1 (the student set to Australia/Perth) View your dashboard You should see an event for assignment 1 due today and it should be under the "today" section in the sort by dates view You should not see the overdue event for assignment 2 because it's more than 14 days old Click the sort by courses view You should see the events categorised the same way Special future man test Log in as s2 (the student set to Australia/Melbourne) View your dashboard You should see the event for assignment 1 in the "next 7 days" section (and the date should show as tomorrow) in the sort by dates view You should see the overdue event for assignment 2 in the "recently overdue" section (and the date should be some time 14 days ago rather than 11:30pm 15 days ago) Click the sort by courses view You should see the events categorised the same way Repeat the tests on both the boost and clean themes
    • Affected Branches:
      MOODLE_33_STABLE
    • Fixed Branches:
      MOODLE_33_STABLE
    • Pull Master Branch:
      MDL-58536-master

      Description

      The event list categorisation into today, next 7 days, next 30 days, etc should use the moodle user midnight calculations which take into account the user's timezone otherwise it can result in incorrect categorisations in the front end.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              ryanwyllie Ryan Wyllie
              Reporter:
              ryanwyllie Ryan Wyllie
              Peer reviewer:
              cameron1729
              Integrator:
              Andrew Nicols
              Tester:
              Eloy Lafuente (stronk7)
              Participants:
              Component watchers:
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias
              Votes:
              2 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                15/May/17