fix: 修复中国环境报,中国教育报采集日期报错问题

This commit is contained in:
皓月归尘 2025-02-07 23:06:10 +08:00
parent 544650bb77
commit 13c7a3f419

View File

@ -67,6 +67,7 @@ async def getData(start_date: datetime, end_date: datetime):
months = [] months = []
# 从开始日期到结束日期,每个月份都添加到列表中 # 从开始日期到结束日期,每个月份都添加到列表中
current_date = start_date current_date = start_date
current_date = current_date.replace(day=1)
while current_date <= end_date: while current_date <= end_date:
months.append(current_date) months.append(current_date)
# 增加一个月 # 增加一个月