~mapperr/trk

ba082165d84467dac67bc3ad2c89323dd025c71b — mapperr 7 months ago 7118192
Fix last week start timestamp
1 files changed, 7 insertions(+), 3 deletions(-)

M trk
M trk => trk +7 -3
@@ 354,9 354,13 @@ show_report() {
    elif [ "$from" = "lastweek" ]; then
        echo 'lastweek report:'
        local last_monday_timestamp=`date -d 'last monday' +'%s'`
        local secs_in_a_day=`expr 3600 \* 24`
        local secs_in_a_week=`expr $secs_in_a_day \* 7`
        local start_timestamp=`expr $last_monday_timestamp - $secs_in_a_week`
        local start_timestamp=$last_monday_timestamp
        # monday is 1 as documented in man date
        if test ! $today_weekday_number -eq 1; then
            local secs_in_a_day=`expr 3600 \* 24`
            local secs_in_a_week=`expr $secs_in_a_day \* 7`
            local start_timestamp=`expr $last_monday_timestamp - $secs_in_a_week`
        fi
        _show_report_from_timestamp_and_offset \
            $start_timestamp 7 "$verbose"
    fi