Skip to content

Commit 04c746e

Browse files
(PC-38798)[BO] feat: better format one-day datespan
1 parent ac665ff commit 04c746e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

api/src/pcapi/routes/backoffice/filters.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,10 @@ def format_datespan(datespan: psycopg2.extras.DateRange) -> str:
303303
end = (datespan.upper - datetime.timedelta(days=1)).strftime("%d/%m/%Y")
304304
else:
305305
end = "∞"
306+
307+
if start == end:
308+
return start
309+
306310
return f"{start}{end}"
307311

308312

0 commit comments

Comments
 (0)