1
0
mirror of https://github.com/flarum/core.git synced 2025-08-06 08:27:42 +02:00

[statistics] fix: add missing last period to custom date ranges (#3661)

* fix: last node in previous data matches first node of current data

* fix: add previous period support for custom periods

* test: update to show previous period for custom range
This commit is contained in:
David Wheatley
2022-11-06 18:21:28 +00:00
committed by GitHub
parent 32ac0a8d8f
commit 9964ddd731
3 changed files with 13 additions and 3 deletions

View File

@@ -73,12 +73,15 @@ class CanRequestCustomTimedStatisticsTest extends TestCase
'users' => [
$timeStart->copy()->getTimestamp() => 1,
$timeStart->copy()->subDays(1)->getTimestamp() => 1,
$timeStart->copy()->subDays(2)->getTimestamp() => 1,
], 'discussions' => [
$timeStart->copy()->getTimestamp() => 1,
$timeStart->copy()->subDays(1)->getTimestamp() => 2,
$timeStart->copy()->subDays(2)->getTimestamp() => 1,
], 'posts' => [
$timeStart->copy()->getTimestamp() => 2,
$timeStart->copy()->subDays(1)->getTimestamp() => 2,
$timeStart->copy()->subDays(2)->getTimestamp() => 1,
]
];