Skip to content

Commit

Permalink
Fix date function by database driver
Browse files Browse the repository at this point in the history
Fix metrics negative variation value display
  • Loading branch information
eliseekn committed Apr 21, 2024
1 parent 933ff6b commit 7ec1af4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/DatesFunctions.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ protected function formatDateColumn(): string
return match ($driver) {
'mysql' => "date($this->dateColumn)",
'pgsql' => "TO_CHAR($this->dateColumn, 'YYYY-MM-DD')",
'default' => "strftime('%Y-%m-%d', $this->dateColumn)",
default => "strftime('%Y-%m-%d', $this->dateColumn)",
};
}

Expand Down
2 changes: 1 addition & 1 deletion src/LaravelMetrics.php
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,7 @@ public function metricsWithVariations(int $previousCount, string $previousPeriod
} elseif ($value < 0) {
$result['variation'] = [
'type' => 'decrease',
'value' => $value,
'value' => abs($value),
];
}

Expand Down

0 comments on commit 7ec1af4

Please sign in to comment.