diff --git a/src/awk/dayview.awk b/src/awk/dayview.awk index 7285169..363716f 100644 --- a/src/awk/dayview.awk +++ b/src/awk/dayview.awk @@ -27,7 +27,7 @@ function color_from_status(status) { # @return: Single-line string function allday(collection, desc, status, color) { color = color_from_status(status) - return collection " " LIGHT_CYAN ITALIC FAINT " (allday) " OFF color desc OFF + return collection " " LIGHT_CYAN ITALIC FAINT " (allday) " OFF color desc OFF } # Return line for multi-day event, or event that starts at midnight, which ends today. @@ -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. @@ -65,7 +65,7 @@ function slice(start, stop, collection, desc, status) { # @input hour: Hour of the entry function hrline(hour) { hour = hour < 10 ? "0"hour : hour - print today, hour, "", "", "", " " FAINT hour ":00 ----------------------" OFF + print today, hour, "", "", "", " " FAINT hour ":00 ----------------------" OFF } # Print lines for hour entries before an event that starts at `start` and stops diff --git a/src/awk/weekview.awk b/src/awk/weekview.awk index c37880f..32daba0 100644 --- a/src/awk/weekview.awk +++ b/src/awk/weekview.awk @@ -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] [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] 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]$/ && dayline { print "+", startofweek " +" $0-1 " days", "", dayline } /^[0-7]$/ { cmd = "date -d '" startofweek " +" $0 " days' +\"%a %e %b %Y\""