feat: dayview: jump to next/previous day

This commit is contained in:
2025-06-12 15:22:27 +02:00
parent cdc008e361
commit dc88d5a965
3 changed files with 30 additions and 16 deletions

View File

@@ -14,7 +14,7 @@ function slice(start, stop, desc) {
}
function hrline(hour) {
hour = hour < 10 ? "0"hour : hour
print hour, "", "", "", FAINT hour ":00 ----------------------" OFF
print today, hour, "", "", "", FAINT hour ":00 ----------------------" OFF
}
function hrlines(start, stop, h, starth, stoph, tmp, i) {
starth = substr(start, 1, 2)
@@ -39,11 +39,11 @@ BEGIN {
OFF = "\033[m"
OFS = "|"
}
$1 == "00:00" && $2 == "00:00" { print $1, $3, $4, $5, allday($6); next }
$1 == "00:00" { print $1, $3, $4, $5, endstoday($2, $6); next }
$1 == "00:00" && $2 == "00:00" { print today, $1, $3, $4, $5, allday($6); next }
$1 == "00:00" { print today, $1, $3, $4, $5, endstoday($2, $6); next }
$1 ~ /^[0-9]{2}:[0-9]{2}$/ {
daystart = hrlines($1, $2, daystart, starth, stoph, tmp, i)
print $1, $3, $4, $5, slice($1, $2, $6)
print today, $1, $3, $4, $5, slice($1, $2, $6)
}
END {
hrlines(dayend":00", 0, daystart, starth, stoph, tmp, i)