resolved timezones

This commit is contained in:
Čarodej
2022-02-06 14:26:42 +01:00
parent 38e86b4b8b
commit 21e184f373
10 changed files with 37 additions and 54 deletions

View File

@@ -66,13 +66,13 @@ class GetDashboardDataController extends Controller
->get();
$upload = $trafficRecords->map(fn ($record) => [
'created_at' => format_date($record->created_at, '%d. %B'),
'created_at' => format_date($record->created_at, 'd. M. '),
'percentage' => intval($trafficRecords->max('upload')) !== 0 ? round(($record->upload / $trafficRecords->max('upload')) * 100, 2) : 0,
'amount' => Metric::bytes($record->upload)->format(),
]);
$download = $trafficRecords->map(fn ($record) => [
'created_at' => format_date($record->created_at, '%d. %B'),
'created_at' => format_date($record->created_at, 'd. M. '),
'percentage' => intval($trafficRecords->max('download')) !== 0 ? round(($record->download / $trafficRecords->max('download')) * 100, 2) : 0,
'amount' => Metric::bytes($record->download)->format(),
]);