From 25ec499dcd16a04fe02167ee9649223d4d2f6ee0 Mon Sep 17 00:00:00 2001 From: Bezhan Salleh Date: Tue, 22 Oct 2024 18:12:22 +0200 Subject: [PATCH] fixes trejectory timezone & session duration order for today v2 --- src/FilamentGoogleAnalytics.php | 2 +- src/Traits/SessionsDuration.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/FilamentGoogleAnalytics.php b/src/FilamentGoogleAnalytics.php index 3566033..9f839dd 100755 --- a/src/FilamentGoogleAnalytics.php +++ b/src/FilamentGoogleAnalytics.php @@ -47,7 +47,7 @@ public function trajectoryValue() public function trajectoryValueAsTimeString() { - return Carbon::createFromTimestamp($this->value)->toTimeString(); + return Carbon::createFromTimestampUTC($this->value)->toTimeString(); } public function trajectoryLabel() diff --git a/src/Traits/SessionsDuration.php b/src/Traits/SessionsDuration.php index 467b9e5..444cfc9 100644 --- a/src/Traits/SessionsDuration.php +++ b/src/Traits/SessionsDuration.php @@ -14,8 +14,8 @@ private function sessionDurationToday(): array $results = $this->get('averageSessionDuration', 'date', Period::days(1)); return [ - 'previous' => $results->first()['value'] ?? 0, - 'result' => $results->last()['value'] ?? 0, + 'previous' => $results->last()['value'] ?? 0, + 'result' => $results->first()['value'] ?? 0, ]; }