~tardypad/dotfiles

ref: a6dbb1a88cef0ea0cf7cb5c3891c1e11b6fa1abc dotfiles/files/configs/zsh/functions/time-tracker-sum -rw-r--r-- 276 bytes
a6dbb1a8 — Damien Tardy-Panis Increase a bit vim timeoutlen 5 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# commands used:
# - sum
# - time-tracker

# display sum of tracked hours reported for a day

local day="$1"

local total

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

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

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