switch to day view
This commit is contained in:
@@ -38,8 +38,10 @@ function print_data(start, dur, end, summary, cmd, collection) {
|
||||
gsub("\\\\;", ";", summary);
|
||||
gsub("\\\\\\\\", "\\", summary);
|
||||
depth = split(FILENAME, path, "/");
|
||||
fpath = path[depth-1] "/" path[depth]
|
||||
collection = depth > 1 ? path[depth-1] : "";
|
||||
collection = collection in collection2label ? collection2label[collection] : collection;
|
||||
collection = collection2label[path[depth-1]]
|
||||
end = dur ? start " " end : end
|
||||
cmd = "date -d '" start "' +\"%s\""
|
||||
cmd | getline start
|
||||
@@ -47,7 +49,7 @@ function print_data(start, dur, end, summary, cmd, collection) {
|
||||
cmd = "date -d '" end "' +\"%s\""
|
||||
cmd | getline end
|
||||
close(cmd)
|
||||
print start, end, collection, summary
|
||||
print start, end, fpath, collection, summary
|
||||
}
|
||||
|
||||
BEGIN {
|
||||
@@ -58,13 +60,6 @@ BEGIN {
|
||||
split(mapping[map], m, "=");
|
||||
collection2label[m[1]] = m[2];
|
||||
}
|
||||
# Colors
|
||||
GREEN = "\033[1;32m";
|
||||
RED = "\033[1;31m";
|
||||
WHITE = "\033[1;97m";
|
||||
CYAN = "\033[1;36m";
|
||||
FAINT = "\033[2m";
|
||||
OFF = "\033[m";
|
||||
}
|
||||
/^END:VEVENT/ && inside { print_data(start, dur, end, summary, cmd, collection); exit }
|
||||
/^DTSTART/ && inside { start = parse( dt) }
|
||||
|
@@ -14,7 +14,7 @@ BEGIN {
|
||||
/^[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 " days", "", dayline; }
|
||||
/^[0-7]$/ && dayline { print "+", startofweek " +" $0-1 " days", "", dayline; }
|
||||
/^[0-7]$/ {
|
||||
cmd = "date -d '" startofweek " +" $0 " days' +\"%a %e %b %Y\"";
|
||||
cmd | getline dayline;
|
||||
|
Reference in New Issue
Block a user