From 060c32d1051278c9f180e8a427b0d594b4eb6bb4 Mon Sep 17 00:00:00 2001 From: haneulai Date: Mon, 26 Jan 2026 11:48:18 +0900 Subject: [PATCH] feat: change stats period to current month and fix label logic --- app/routers/stats.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/routers/stats.py b/app/routers/stats.py index 601e66c..76ab501 100644 --- a/app/routers/stats.py +++ b/app/routers/stats.py @@ -39,9 +39,11 @@ async def get_plant_stats( today = datetime.now().date() today_str = today.isoformat() + # 1. 과거 데이터 조회 (daily_stats) # 1. 과거 데이터 조회 (daily_stats) if period == "day": - start_date = today - timedelta(days=30) + # 이번 달 1일부터 오늘까지 + start_date = today.replace(day=1) date_filter = start_date.isoformat() elif period == "month": start_date = today.replace(day=1) - timedelta(days=365)