fixed time tracker

This commit is contained in:
KeeganForelight 2023-01-24 20:39:48 -05:00
parent 5789995466
commit 8b58fe60b2

View File

@ -105,12 +105,11 @@ totalHours() {
# session exists, get info # session exists, get info
source "$CURRENT_SESSION" source "$CURRENT_SESSION"
# printing to timesheet # printing to timesheet
TIME_OUT=$(date +%s) TOTAL_TIME=$(($(date +%s) - $TIME_IN))
TOTAL_TIME=$(($TIME_OUT - $TIME_IN + 3600 * 5))
# add to total # add to total
hours=$(($TOTAL_TIME / 3600 + $hours)) hours=$(($TOTAL_TIME / 3600 + $hours)) # nearest hour
mins=$(($TOTAL_TIME / 60 + $mins)) mins=$(($TOTAL_TIME / 60 + $mins)) # nearest minute
printf 'Today worked %s\n' $(date -d @$TOTAL_TIME +%H:%M) printf 'So far Today worked %s\n' $(date -d @$(($TOTAL_TIME + 3600 * 5)) +%H:%M)
fi fi
hours=$(($hours + $mins/60)) # overflow hours=$(($hours + $mins/60)) # overflow
mins=$(($mins%60)) mins=$(($mins%60))