From f5676a04dd82cd938bd0fd71f1ea66473e462c66 Mon Sep 17 00:00:00 2001
From: Paolo Brasolin <paolo.brasolin@eurac.edu>
Date: Tue, 5 Apr 2022 14:39:28 +0200
Subject: [PATCH] feat: #be use gmtm for shot length in dashboard

---
 backend/src/index.ts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/backend/src/index.ts b/backend/src/index.ts
index 325c1bf..e60436f 100644
--- a/backend/src/index.ts
+++ b/backend/src/index.ts
@@ -81,7 +81,7 @@ server.get("/", async (request, reply) => {
     .table("shots")
     .select(
       connection.raw(
-        "width_bucket(extract(epoch from ended_at - began_at)*1000, 0, 60*1000, 60*10)*100 as bucket, count(*)",
+        "width_bucket(ended_at_gmtm - began_at_gmtm, 0, 60*1000, 60*10)*100 as bucket, count(*)",
       ),
     )
     .groupBy("bucket")
-- 
GitLab