HokieGeek / hrs

A silly little script which lets me easily keep track of hours worked at home
0 stars 0 forks source link

Single entries spanning multiple days are not displayed as multiple days #1

Open HokieGeek opened 7 years ago

HokieGeek commented 7 years ago
HokieGeek commented 7 years ago

Possible solution is that, on every entry, create an array which holds all of the necessary dates and then loops through and prints each with the label.

For example, on an entry which crosses midnight

entries[length(entries)] = ($1FS<DAY 23:59:59>)
entries[length(entries)] = (<DAY+1 00:00:00>FS$2)
....
$1 = $2 = ""
sub(/^[[:space:]]*/, "", $0)
for (e in entries) {
    printf("%s", entries[e])
    print
}