From c8465070044d1e475c7b7e0bdcafec20c389f68f Mon Sep 17 00:00:00 2001 From: r-carroll Date: Mon, 7 Oct 2024 16:25:28 -0400 Subject: [PATCH] update new reading goal --- pi/backend/app.js | 4 ++-- static/reading.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pi/backend/app.js b/pi/backend/app.js index 249c2ea..9d4c851 100644 --- a/pi/backend/app.js +++ b/pi/backend/app.js @@ -85,7 +85,7 @@ async function getPrayerMinutes() { } async function getReadingMinutes() { - const readQuery = 'select sum(duration) from reading;'; + const readQuery = "select sum(duration) from reading where submitted_time > '2024-08-24 17:31:26.652635';"; let readResult = await queryDB(readQuery); return readResult.rows[0].sum || 0; } @@ -105,7 +105,7 @@ async function getReadingByTimespan() { const readQuery = `select json_agg(subquery) as timespans from (select *, extract(hour from submitted_time) as hour, extract(dow from submitted_time) as day - from reading where submitted_time is not null order by hour) as subquery;` + from reading where submitted_time is not null and submitted_time > '2024-08-24 17:31:26.652635' order by hour) as subquery;` const readResult = await queryDB(readQuery); diff --git a/static/reading.js b/static/reading.js index 15a91e3..354256d 100644 --- a/static/reading.js +++ b/static/reading.js @@ -1,6 +1,6 @@ const apiUrl = 'https://drive.carrollmedia.dev:3008'; -const WEEKLY_GOAL = 560; -const TOTAL_GOAL = 1680; +const WEEKLY_GOAL = 700; +const TOTAL_GOAL = 4800; let tally = 0; function init() { // enable active states for buttons in mobile safari