diff --git a/src/Adapters/SqliteAdapter.php b/src/Adapters/SqliteAdapter.php index 3e17022..d45ef81 100644 --- a/src/Adapters/SqliteAdapter.php +++ b/src/Adapters/SqliteAdapter.php @@ -8,6 +8,12 @@ class SqliteAdapter extends AbstractAdapter { public function format(string $column, string $interval): string { + // Fix wrong week date format after SQLite v3.46 + // Using coalesce for backward compatibility + if ($interval === 'week') { + return "coalesce(strftime('%G-%V', {$column}), strftime('%Y-%W', {$column}))"; + } + $format = match ($interval) { 'minute' => '%Y-%m-%d %H:%M:00', 'hour' => '%Y-%m-%d %H:00',