Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Month-long data in a year-long report. Current time of day period separation instead of midnight. #26

Open
OT-AndreyUskov opened this issue Sep 6, 2024 · 1 comment

Comments

@OT-AndreyUskov
Copy link

OT-AndreyUskov commented Sep 6, 2024

Hello.

it's me again.
I've found another couple of problems in the report.

in file /report/overviewstats/classes/chart.php:459
in method prepare_data_chart_enrollments($course)
in $params for $reader->get_events_select
there is a parameter:
'timestart' => $now - 30 * DAYSECS,
where
$now = time();

  1. The main problem is that the report shows a graph for the last year, but only uses data for the last 30 days.
  2. Another problem is that the data the report displays depends on what time of day the report is run. The report should take into account current user's timezone (preferable) or server's timezone and split data in midnight because when the report shows a value for a day the user expects it to represent data from midnight to midnight. And users will not understand why the values for past periods change depending on the time they view the report.

You can use Moodle Time API for the purpose of getting user's midnight time and timezones.
4.1 LTS - https://moodledev.io/docs/4.1/apis/subsystems/time
4.5 - https://moodledev.io/docs/4.5/apis/subsystems/time

Thank you.

@OT-AndreyUskov
Copy link
Author

I've found this issue #20. It shouldn't have been closed because #2 is a different issue.
While this issue is a bug related to initial data, #2 is an enhancement related to data representation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant