Skip to content

Commit

Permalink
Merge pull request #79 from bezhanSalleh/patchV2/session-duration-ord…
Browse files Browse the repository at this point in the history
…er-for-today

[Fix] Session Duration trajectory timezone(UTC) & Today filter order v2
  • Loading branch information
bezhanSalleh authored Oct 22, 2024
2 parents c22f8ac + 25ec499 commit 3d42155
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/FilamentGoogleAnalytics.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions src/Traits/SessionsDuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
];
}

Expand Down

0 comments on commit 3d42155

Please sign in to comment.