You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Time zone of the application has been set to Europe/Zurich in config.inc.php
Access logs and usage event logs record in the date/time of the selected time zone, not UTC.
E.g. date range is chosen 2024-12-16 - 2025-01-15 (last 30 days).
Abszissa shows a range of 15 December 2024 - 14 January 2025 (screenshot1). Correct should be 16 December 2024 - 15 January 2025.
First data point shows a date of 15 December 2024 (screenshot2). Correct should be 16 December 2024
Last data point shows a date of 14 January 2025 (screenshot3). Correct should be 15 January 2025.
Add a var_dump($timeline) statement after the definition of the $timeline variable in PKPStatsHandler, around
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
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.
pkp-lib/pages/stats/PKPStatsHandler.php
Line 253 in 1b31467
[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
The text was updated successfully, but these errors were encountered: