Set sensible default dates for CLI export
Created by: MaciekChudek
Currently exporting from the command line without specifying dates defaults to dt.datetime.combine(dt.date.today(), dt.time()), start_time.replace(hour=23, minute=59, second=59)
which results in an activity report for right now to the end of today, which has the actual activities missing since it hasn't happened yet. It would be nice if this instead assumed sensible defaults, such as a single day report of the same format as overview.py generates, or a one week report of the same sort overview.py generates.
In the meantime, here's a bash workaround:
datediff() {
d1=$(date -d "$1" +%s)
d2=$(date -d "$2" +%s)
echo $(( (d2 - d1) / 86400 ))
}
if [ $(datediff monday sunday) -lt 0 ]
then
monday='last-monday'
else
monday='monday'
fi
hamster export html `date +%Y-%m-%d -d $monday` `date +%Y-%m-%d -d sunday`
Still doesn't seem to include the per-day activity report though....