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