From d7915ed8ca5272c0feaca319c0237f8408d8031d Mon Sep 17 00:00:00 2001
From: T <t@tjp.lol>
Date: Tue, 12 Aug 2025 15:02:28 -0600
Subject: fix time zones

---
 internal/database/queries.sql | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

(limited to 'internal/database/queries.sql')

diff --git a/internal/database/queries.sql b/internal/database/queries.sql
index 969119a..6d1108f 100644
--- a/internal/database/queries.sql
+++ b/internal/database/queries.sql
@@ -82,8 +82,8 @@ select
 from time_entry te
 join client c on te.client_id = c.id
 left join project p on te.project_id = p.id
-where date(te.start_time) >= date('now', 'weekday 1', '-6 days')
-    and date(te.start_time) <= date('now')
+where date(te.start_time, 'localtime') >= date('now', 'localtime', 'weekday 0', '-6 days')
+    and date(te.start_time) <= date('now', 'utc')
 group by p.id, p.name, c.id, c.name
 order by c.name, p.name;
 
@@ -104,8 +104,8 @@ select
 from time_entry te
 join client c on te.client_id = c.id
 left join project p on te.project_id = p.id
-where date(te.start_time) >= date('now', 'start of month')
-    and date(te.start_time) <= date('now')
+where date(te.start_time, 'localtime') >= date('now', 'localtime', 'start of month')
+    and date(te.start_time) <= date('now', 'utc')
 group by p.id, p.name, c.id, c.name
 order by c.name, p.name;
 
@@ -292,7 +292,7 @@ select
         end
     ) as integer) as total_seconds
 from time_entry te
-where date(te.start_time) = date('now');
+where date(te.start_time, 'localtime') = date('now', 'localtime');
 
 -- name: GetRecentTimeEntries :many
 select * from time_entry 
-- 
cgit v1.2.3

