mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-30 01:52:18 +00:00
Fix spend logs UI date filtering for UTC timestamps
This commit is contained in:
parent
d124a28df4
commit
d2151e38bf
1 changed files with 6 additions and 4 deletions
|
|
@ -1793,6 +1793,8 @@ async def ui_view_spend_logs( # noqa: PLR0915
|
|||
|
||||
start_date_obj = parse_date(start_date)
|
||||
end_date_obj = parse_date(end_date)
|
||||
start_date_sql = start_date_obj.replace(tzinfo=None)
|
||||
end_date_sql = end_date_obj.replace(tzinfo=None)
|
||||
|
||||
# Convert to ISO format strings for Prisma
|
||||
start_date_iso = start_date_obj.isoformat() # Already in UTC, no need to add Z
|
||||
|
|
@ -1909,11 +1911,11 @@ async def ui_view_spend_logs( # noqa: PLR0915
|
|||
p = 1 # parameter index counter
|
||||
|
||||
# Date range (always present)
|
||||
sql_conditions.append(f'"startTime" >= ${p}::timestamptz')
|
||||
sql_params.append(start_date_obj)
|
||||
sql_conditions.append(f'"startTime" >= ${p}::timestamp')
|
||||
sql_params.append(start_date_sql)
|
||||
p += 1
|
||||
sql_conditions.append(f'"startTime" <= ${p}::timestamptz')
|
||||
sql_params.append(end_date_obj)
|
||||
sql_conditions.append(f'"startTime" <= ${p}::timestamp')
|
||||
sql_params.append(end_date_sql)
|
||||
p += 1
|
||||
|
||||
# Equality filters - read effective values from where_conditions (post-authorization)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue