improved utf-8 usage, and color scheme

This commit is contained in:
Ämin Baumeler 2025-06-17 15:19:21 +02:00
parent 6d1d5ce1c6
commit 2e96e31a5b
2 changed files with 8 additions and 8 deletions

View File

@ -40,7 +40,7 @@ function allday(collection, desc, status, color) {
# @return: Single-line string
function endstoday(stop, collection, desc, status) {
color = color_from_status(status)
return collection " " LIGHT_CYAN " -- " stop OFF ": " color desc OFF
return collection " " LIGHT_CYAN " → " stop ": " OFF color desc OFF
}
# Return line for event that starts sometime today.
@ -55,9 +55,9 @@ function endstoday(stop, collection, desc, status) {
function slice(start, stop, collection, desc, status) {
color = color_from_status(status)
if (stop == "00:00")
return collection " " LIGHT_CYAN start " -- " OFF ": " color desc OFF
return collection " " LIGHT_CYAN start " → " ": " OFF color desc OFF
else
return collection " " LIGHT_CYAN start OFF " -- " LIGHT_CYAN stop OFF ": " color desc OFF
return collection " " LIGHT_CYAN start " " stop ": " OFF color desc OFF
}
# Print line for a single hour entry.

View File

@ -22,9 +22,9 @@ BEGIN {
OFS = "|"
}
/^[0-7] 00:00 -- 00:00/ { dayline = dayline " " c(); next }
/^[0-7] 00:00 -- / { dayline = dayline " <--" $4 " " c(); next }
/^[0-7] 00:00 -- / { dayline = dayline " " $4 " " c(); next }
/^[0-7] [0-9]{2}:[0-9]{2} -- 00:00/ { dayline = dayline " " $2 " → " c(); next }
/^[0-7] [0-9]{2}:[0-9]{2} -- [0-9]{2}:[0-9]{2}/ { dayline = dayline " " $2 " - " $4 " " c(); next }
/^[0-7] [0-9]{2}:[0-9]{2} -- [0-9]{2}:[0-9]{2}/ { dayline = dayline " " $2 " " $4 " " c(); next }
/^[0-7]$/ && dayline { print "+", startofweek " +" $0-1 " days", "", dayline }
/^[0-7]$/ {
cmd = "date -d '" startofweek " +" $0 " days' +\"%a %e %b %Y\""