Fix NaT bug on empty states and update volume type
Some checks failed
Deploy via SSH / deploy (push) Failing after 1s
Some checks failed
Deploy via SSH / deploy (push) Failing after 1s
This commit is contained in:
parent
e3c1748d6a
commit
ad48295484
2 changed files with 2 additions and 5 deletions
2
app.py
2
app.py
|
|
@ -190,7 +190,7 @@ with col2:
|
||||||
|
|
||||||
# Reindex to ensure we cover from START_DATE to Today (or Max Date)
|
# Reindex to ensure we cover from START_DATE to Today (or Max Date)
|
||||||
# This ensures weeks with 0 work are counted in the average
|
# This ensures weeks with 0 work are counted in the average
|
||||||
max_date = max(df['date'].max(), pd.Timestamp.now())
|
max_date = pd.Timestamp.now() if df.empty or pd.isna(df['date'].max()) else max(df['date'].max(), pd.Timestamp.now())
|
||||||
full_weeks = pd.date_range(start=START_DATE, end=max_date, freq='W-MON')
|
full_weeks = pd.date_range(start=START_DATE, end=max_date, freq='W-MON')
|
||||||
weekly_data = weekly_data.reindex(full_weeks, fill_value=0)
|
weekly_data = weekly_data.reindex(full_weeks, fill_value=0)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,8 +9,5 @@ services:
|
||||||
environment:
|
environment:
|
||||||
- DB_FILE=/data/work_log.db
|
- DB_FILE=/data/work_log.db
|
||||||
volumes:
|
volumes:
|
||||||
- tracker_data:/data
|
- ./:/data
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|
||||||
volumes:
|
|
||||||
tracker_data:
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue