File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
api/src/pcapi/routes/backoffice Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -297,10 +297,14 @@ def format_timespan(timespan: psycopg2.extras.DateTimeRange) -> str:
297297def format_datespan (datespan : psycopg2 .extras .DateRange ) -> str :
298298 if not datespan :
299299 return ""
300- start = datespan .lower .strftime ("%d/%m/%Y" )
300+ start_date = datespan .lower
301+ start = start_date .strftime ("%d/%m/%Y" )
301302 if datespan .upper :
302303 # upper bound is exclusive, and we want to show the last day included in the date range
303- end = (datespan .upper - datetime .timedelta (days = 1 )).strftime ("%d/%m/%Y" )
304+ end_date = datespan .upper - datetime .timedelta (days = 1 )
305+ if start_date == end_date :
306+ return start
307+ end = end_date .strftime ("%d/%m/%Y" )
304308 else :
305309 end = "∞"
306310 return f"{ start } → { end } "
You can’t perform that action at this time.
0 commit comments