This commit is contained in:
jze9
2026-05-15 20:12:44 +05:00
parent 2335497226
commit dd7d8a7ccf
21 changed files with 672 additions and 121 deletions

View File

@@ -75,13 +75,15 @@ async def list_news(
if date_from:
try:
base = base.where(Article.published_at >= datetime.fromisoformat(date_from))
dt = datetime.fromisoformat(date_from.replace("Z", "+00:00"))
base = base.where(Article.published_at >= dt.replace(tzinfo=None))
except ValueError:
pass
if date_to:
try:
base = base.where(Article.published_at <= datetime.fromisoformat(date_to))
dt = datetime.fromisoformat(date_to.replace("Z", "+00:00"))
base = base.where(Article.published_at <= dt.replace(tzinfo=None))
except ValueError:
pass