diff --git a/backend/server/app.py b/backend/server/app.py index 482eee1..7190b19 100644 --- a/backend/server/app.py +++ b/backend/server/app.py @@ -290,8 +290,14 @@ async def get_products( query = supabase.table(table).select('*') # filter by exact date_index if provided + # dateIndex from frontend is days from today, convert to days since epoch if dateIndex is not None: - query = query.eq('date_index', dateIndex) + from datetime import datetime + epoch = datetime(1970, 1, 1) + today = datetime.now().replace(hour=0, minute=0, second=0, microsecond=0) + today_index = int((today - epoch).total_seconds() / 86400) + actual_date_index = today_index + dateIndex + query = query.eq('date_index', actual_date_index) response = query.execute() results = response.data diff --git a/web/src/app/cart/page.tsx b/web/src/app/cart/page.tsx index d487d40..30ac3f2 100644 --- a/web/src/app/cart/page.tsx +++ b/web/src/app/cart/page.tsx @@ -96,7 +96,10 @@ export default function CartPage() { ${total.toFixed(2)}