feat: change stats period to current month and fix label logic
This commit is contained in:
parent
15e611ebb6
commit
060c32d105
|
|
@ -39,9 +39,11 @@ async def get_plant_stats(
|
||||||
today = datetime.now().date()
|
today = datetime.now().date()
|
||||||
today_str = today.isoformat()
|
today_str = today.isoformat()
|
||||||
|
|
||||||
|
# 1. 과거 데이터 조회 (daily_stats)
|
||||||
# 1. 과거 데이터 조회 (daily_stats)
|
# 1. 과거 데이터 조회 (daily_stats)
|
||||||
if period == "day":
|
if period == "day":
|
||||||
start_date = today - timedelta(days=30)
|
# 이번 달 1일부터 오늘까지
|
||||||
|
start_date = today.replace(day=1)
|
||||||
date_filter = start_date.isoformat()
|
date_filter = start_date.isoformat()
|
||||||
elif period == "month":
|
elif period == "month":
|
||||||
start_date = today.replace(day=1) - timedelta(days=365)
|
start_date = today.replace(day=1) - timedelta(days=365)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user