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

Improve definitions of previous/next relative date filters

    XMLWordPrintable

Details

    • MOODLE_400_STABLE
    • MOODLE_400_STABLE
    • Hide

      Note: ideally this requires a site with historical config data, so that we can see the effect of filtering by relative time (previous month, current week, etc) - these tests are identical to those in MDL-72662 other than the table for reference in step 4.

      1. Login as admin
      2. Navigate to Reports > Config changes in site administration
      3. Press Filters button
      4. Using the following table as a guide, confirm you see appropriate report data after applying Filter (note this requires knowing the Current date i.e. today, so adjust Expected filter date range as you see fit):
        Current time Filter Expected filter
        19/01/22 09:30 Last 2 days 17/01/22 09:30 - 19/01/22 09:30
        19/01/22 09:30 Last 2 weeks 05/01/22 09:30 - 19/01/22 09:30
        19/01/22 09:30 Last 2 months 19/11/21 09:30 - 19/01/22 09:30
        19/01/22 09:30 Last 2 years 19/01/20 09:30 - 19/01/22 09:30
        19/01/22 09:30 Current day 19/01/22 00:00 - 19/01/22 23:59
        19/01/22 09:30 Current week 17/01/22 00:00 - 23/01/22 23:59
        19/01/22 09:30 Current month 01/01/22 00:00 - 31/01/22 23:59
        19/01/22 09:30 Current year 01/01/22 00:00 - 31/12/22 23:59
      1. After applying the filter, only those config changes falling within Expected filter date range should be shown in the report
      2. Confirm unit tests pass:

        $ vendor/bin/phpunit reportbuilder/tests/local/filters/date_test.php
        

      Show
      Note: ideally this requires a site with historical config data, so that we can see the effect of filtering by relative time (previous month, current week, etc) - these tests are identical to those in MDL-72662 other than the table for reference in step 4. Login as admin Navigate to Reports > Config changes in site administration Press Filters button Using the following table as a guide, confirm you see appropriate report data after applying Filter (note this requires knowing the Current date i.e. today, so adjust Expected filter date range as you see fit): Current time Filter Expected filter 19/01/22 09:30 Last 2 days 17/01/22 09:30 - 19/01/22 09:30 19/01/22 09:30 Last 2 weeks 05/01/22 09:30 - 19/01/22 09:30 19/01/22 09:30 Last 2 months 19/11/21 09:30 - 19/01/22 09:30 19/01/22 09:30 Last 2 years 19/01/20 09:30 - 19/01/22 09:30 19/01/22 09:30 Current day 19/01/22 00:00 - 19/01/22 23:59 19/01/22 09:30 Current week 17/01/22 00:00 - 23/01/22 23:59 19/01/22 09:30 Current month 01/01/22 00:00 - 31/01/22 23:59 19/01/22 09:30 Current year 01/01/22 00:00 - 31/12/22 23:59 After applying the filter, only those config changes falling within Expected filter date range should be shown in the report Confirm unit tests pass: $ vendor/bin/phpunit reportbuilder/tests/local/filters/date_test.php

    Description

      This issue is to collect together thoughts on improving how the Previous and Next relative date condition/filter values are

      1. Presented to the user;
      2. Implemented

      See the testing steps on MDL-72662 to see how Previous currently works

      Given today is Friday 17:20
      When I select "Previous 2 days"
      Then I see data for Wednesday 00:00 to Thursday 23:59 (Option A: i.e. current)

      This may not be what users expect, alternatives

      B) Wednesday 00:00 to Friday 17:20
      C) Wednesday 17:20 to Friday 17:20 - See comments: this was chosen as the solution to implement here, in addition to changing "Previous" to "Last"
      D) Thursday 00:00 to Friday 17:20

      Suggestions also include changing "Previous 2 days" to "Last 2 days" (thanks tsala)

      Attachments

        Issue Links

          Activity

            People

              pholden Paul Holden
              pholden Paul Holden
              Mikel Martín Corrales Mikel Martín Corrales
              Jake Dallimore Jake Dallimore
              Gladys Basiana Gladys Basiana
              David Carrillo, Paul Holden
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                19/Apr/22

                Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 4 hours, 30 minutes
                  4h 30m