[widgets] Fix the date filter
All checks were successful
build & deploy / test (push) Successful in 1m48s
build & deploy / deploy (push) Successful in 22s

This commit is contained in:
2026-03-31 17:19:14 -04:00
parent 192d0c489b
commit 0a74c692d2
2 changed files with 62 additions and 42 deletions

View File

@ -84,11 +84,12 @@ def live_charts(
chart_period: str = "all",
limit: int = 15,
app_label: str = "music",
as_of: datetime = None,
) -> QuerySet:
now = timezone.now()
now = as_of if as_of else timezone.now()
tzinfo = now.tzinfo
now = now.date()
if user.is_authenticated:
if user.is_authenticated and not as_of:
now = now_user_timezone(user.profile)
tzinfo = now.tzinfo