diff --git a/timetracker.sh b/timetracker.sh index 1b78419..527ede2 100755 --- a/timetracker.sh +++ b/timetracker.sh @@ -105,11 +105,11 @@ totalHours() { # session exists, get info source "$CURRENT_SESSION" # printing to timesheet - TOTAL_TIME=$(($(date +%s) - $TIME_IN)) + time=$(date -d @$(($(date +%s) - $TIME_IN + 3600 * 5)) +%H:%M) # add to total - 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) + hours=$(($hours + 10#$(echo "$time" | awk -F : '{print $1}'))) + mins=$(($mins + 10#$(echo "$time" | awk -F : '{print $2}'))) + printf 'So far Today worked %s\n' $time fi hours=$(($hours + $mins/60)) # overflow mins=$(($mins%60))