~tardypad/dotfiles

ref: ba06b7490a70c2011970e1b6c4be2109ca81b45a dotfiles/files/configs/zsh/functions/time-tracker-sum -rw-r--r-- 325 bytes
ba06b749 — Damien Tardy-Panis Fix time-tracker-sum with day option change 5 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# commands used:
# - sum
# - time-tracker

# display sum of tracked hours reported for a day

local day="$1"

[ -n "${day}" ] || day="$( date +%Y-%m-%d )"

local total

total=$(
  time-tracker -t -d "$day" overview \
    | cut -f 2 \
    | sum
)

[ "$?" -ne 0 ] && return 1

printf '%.1f\n' $( echo "${total} / 60" | bc -l )