Fix another duration formatting error
This commit is contained in:
parent
76bf03b482
commit
03e89a92c7
|
@ -6,7 +6,7 @@ RUN npm install && \
|
||||||
|
|
||||||
FROM python:3.10-slim-bullseye
|
FROM python:3.10-slim-bullseye
|
||||||
|
|
||||||
ENV VERSION_NUMBER 0.1.0-36-ge6b5804
|
ENV VERSION_NUMBER 0.1.0-37-g76bf03b
|
||||||
ENV PROD 1
|
ENV PROD 1
|
||||||
|
|
||||||
RUN useradd --create-home --uid 1000 timetracker
|
RUN useradd --create-home --uid 1000 timetracker
|
||||||
|
|
|
@ -22,6 +22,8 @@ def format_duration(
|
||||||
minute_seconds = 60
|
minute_seconds = 60
|
||||||
hour_seconds = 60 * minute_seconds
|
hour_seconds = 60 * minute_seconds
|
||||||
day_seconds = 24 * hour_seconds
|
day_seconds = 24 * hour_seconds
|
||||||
|
if not isinstance(duration, timedelta):
|
||||||
|
duration = timedelta(seconds=duration)
|
||||||
seconds_total = int(duration.total_seconds())
|
seconds_total = int(duration.total_seconds())
|
||||||
# timestamps where end is before start
|
# timestamps where end is before start
|
||||||
if seconds_total < 0:
|
if seconds_total < 0:
|
||||||
|
|
Loading…
Reference in New Issue