mirror of
https://github.com/flarum/core.git
synced 2025-08-06 16:36:47 +02:00
🐛 Make sure summed value is a number (#14)
This commit is contained in:
@@ -176,7 +176,7 @@ export default class StatisticsWidget extends DashboardWidget {
|
|||||||
|
|
||||||
for (const time in timed) {
|
for (const time in timed) {
|
||||||
if (time >= period.start && time < period.end) {
|
if (time >= period.start && time < period.end) {
|
||||||
count += timed[time];
|
count += parseInt(timed[time]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -88,7 +88,7 @@ class AddStatisticsData
|
|||||||
|
|
||||||
$results->each(function ($count, $time) use (&$timed, $userTimezone) {
|
$results->each(function ($count, $time) use (&$timed, $userTimezone) {
|
||||||
$time = new DateTime($time, $userTimezone);
|
$time = new DateTime($time, $userTimezone);
|
||||||
$timed[$time->getTimestamp()] = $count;
|
$timed[$time->getTimestamp()] = (int) $count;
|
||||||
});
|
});
|
||||||
|
|
||||||
return $timed;
|
return $timed;
|
||||||
|
Reference in New Issue
Block a user