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

Wrong translation between actual date of data point in statistics views and date label #10813

Open
mpbraendle opened this issue Jan 16, 2025 · 0 comments

Comments

@mpbraendle
Copy link
Contributor

mpbraendle commented Jan 16, 2025

Describe the bug
In the statistics display (e.g. /stats/publications/publications, daily view, last 30 or 90 days), the displayed date range does not fit the selected date range (see screenshots). It may be shifted by one day.

The user is given the impression that a day may be missing. May be confusing.

This might be due to a conversion error between the effective date in the data and the label of the data, e.g. because of the selected time zone. See "to reproduce".

To Reproduce
All statistics have been calculated up to the end of the selected date range and are available.

  1. Time zone of the application has been set to Europe/Zurich in config.inc.php
  2. Access logs and usage event logs record in the date/time of the selected time zone, not UTC.
  3. E.g. date range is chosen 2024-12-16 - 2025-01-15 (last 30 days).
  4. Abszissa shows a range of 15 December 2024 - 14 January 2025 (screenshot1). Correct should be 16 December 2024 - 15 January 2025.
  5. First data point shows a date of 15 December 2024 (screenshot2). Correct should be 16 December 2024
  6. Last data point shows a date of 14 January 2025 (screenshot3). Correct should be 15 January 2025.
  7. Add a var_dump($timeline) statement after the definition of the $timeline variable in PKPStatsHandler, around
  8. Inspect the dumped timeline array - this shows that the dates are indeed correct, but the labels are wrong, shifted by one day, e.g.,
    [0]=> array(3) { ["date"]=> string(10) "2024-12-16" ["label"]=> string(16) "15 December 2024" ["value"]=> string(4) "2081" } [1]=> array(3) { ["date"]=> string(10) "2024-12-17" ["label"]=> string(16) "16 December 2024" ["value"]=> string(4) "1887" }
    See screenshot4. May this be due to a wrong conversion?

What application are you using?
OJS 3.4.0-8 (and previous OJS 3.4 versions)
PHP 8.2

Additional information
@bozana

Image Image Image Image
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