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

Implement relative date options in the Reportbuilder date filter

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 4.0
    • Fix Version/s: 4.0
    • Component/s: Report builder
    • Labels:
    • Affected Branches:
      MOODLE_400_STABLE
    • Fixed Branches:
      MOODLE_400_STABLE
    • Pull Master Branch:
    • Testing Instructions:
      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)

      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 date Filter Expected filter
        28/09/21 Previous 2 days 26/09/21 00:00 - 27/09/21 23:59
        28/09/21 Previous 2 weeks 13/09/21 00:00 - 26/09/21 23:59
        28/09/21 Previous 2 months 01/07/21 00:00 - 31/08/21 23:59
        28/09/21 Previous 2 years 01/01/19 00:00 - 31/12/20 23:59
        28/09/21 Current day 28/09/21 00:00 - 28/09/21 23:59
        28/09/21 Current week 27/09/21 00:00 - 03/10/21 23:59
        28/09/21 Current month 01/09/21 00:00 - 30/09/21 23:59
        28/09/21 Current year 01/01/21 00:00 - 31/12/21 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) 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 date Filter Expected filter 28/09/21 Previous 2 days 26/09/21 00:00 - 27/09/21 23:59 28/09/21 Previous 2 weeks 13/09/21 00:00 - 26/09/21 23:59 28/09/21 Previous 2 months 01/07/21 00:00 - 31/08/21 23:59 28/09/21 Previous 2 years 01/01/19 00:00 - 31/12/20 23:59 28/09/21 Current day 28/09/21 00:00 - 28/09/21 23:59 28/09/21 Current week 27/09/21 00:00 - 03/10/21 23:59 28/09/21 Current month 01/09/21 00:00 - 30/09/21 23:59 28/09/21 Current year 01/01/21 00:00 - 31/12/21 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

      We currently support absolute dates only

      Support relative dates (previous two days, etc) to be used as either filters or conditions - provide simple API to switch between modes (absolute/filter vs. relative/condition) and also allow developer to mix and match which operators they want to use for their filter (note: this is already possible in current filter API)

        Attachments

          Activity

            People

            Assignee:
            pholden Paul Holden
            Reporter:
            pholden Paul Holden
            Peer reviewer:
            Carlos Castillo Carlos Castillo
            Integrator:
            Ilya Tregubov Ilya Tregubov
            Tester:
            Gladys Basiana Gladys Basiana
            Participants:
            Component watchers:
            David Matamoros, Paul Holden
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 day, 1 hour, 50 minutes
                1d 1h 50m