Improve output again

This commit is contained in:
Philippe Caseiro 2022-03-24 14:16:51 +01:00
parent 5a00aee3f2
commit f7ebc0409f
1 changed files with 8 additions and 5 deletions

13
badgy
View File

@ -68,20 +68,23 @@ getCapitalTime()
st=$(date --date="${starts}" +'%s')
ends=$(echo ${cl} | jq -rc ".end")
echo
echo " $(date --date=${starts} +"%A %d %B %Y:")"
echo " Start: $(date --date=${starts} +'%H:%M')"
echo -n " $(date --date=${starts} +"%A %d %B %Y") "
echo -n "$(date --date=${starts} +'%H:%M') to "
if [ "${ends}" != "null" ];then
ed=$(date --date="${ends}" +'%s')
echo " End: $(date --date=${ends} +'%H:%M')"
echo -n "$(date --date=${ends} +'%H:%M')"
else
ed=$(date +'%s')
echo " End: running"
echo -n "....."
fi
dr=$(( dr + (ed - st)))
timerCount="$((ed - st))"
echo -n " ($(s2h ${timerCount}))"
dr=$(( dr + timerCount))
done
nbl=$(getNewBalance "${sl}" "${dr}")
echo
echo
echo "Your time balance is: ${sl}"
echo "Today you worked: $(s2h ${dr})"