fixed time tracker
This commit is contained in:
parent
5789995466
commit
8b58fe60b2
@ -105,12 +105,11 @@ totalHours() {
|
||||
# session exists, get info
|
||||
source "$CURRENT_SESSION"
|
||||
# printing to timesheet
|
||||
TIME_OUT=$(date +%s)
|
||||
TOTAL_TIME=$(($TIME_OUT - $TIME_IN + 3600 * 5))
|
||||
TOTAL_TIME=$(($(date +%s) - $TIME_IN))
|
||||
# add to total
|
||||
hours=$(($TOTAL_TIME / 3600 + $hours))
|
||||
mins=$(($TOTAL_TIME / 60 + $mins))
|
||||
printf 'Today worked %s\n' $(date -d @$TOTAL_TIME +%H:%M)
|
||||
hours=$(($TOTAL_TIME / 3600 + $hours)) # nearest hour
|
||||
mins=$(($TOTAL_TIME / 60 + $mins)) # nearest minute
|
||||
printf 'So far Today worked %s\n' $(date -d @$(($TOTAL_TIME + 3600 * 5)) +%H:%M)
|
||||
fi
|
||||
hours=$(($hours + $mins/60)) # overflow
|
||||
mins=$(($mins%60))
|
||||
|
Loading…
x
Reference in New Issue
Block a user