From a8ceef8126ddd507b8f5a6e3a20a542fa1244252 Mon Sep 17 00:00:00 2001 From: June McEnroe Date: Fri, 3 Dec 2021 15:51:06 -0500 Subject: Show weeks plus days --- bin/when.y | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/bin/when.y b/bin/when.y index 882fe60c..a9f6d1ed 100644 --- a/bin/when.y +++ b/bin/when.y @@ -139,8 +139,12 @@ static void printScalar(struct tm scalar) { printf("%dw ", scalar.tm_mday / 7); } if (scalar.tm_yday && scalar.tm_mon) { - if (scalar.tm_yday % 7 == 0) { - printf("(%dw) ", scalar.tm_yday / 7); + if (scalar.tm_yday >= 7) { + printf("(%dw", scalar.tm_yday / 7); + if (scalar.tm_yday % 7) { + printf(" %dd", scalar.tm_yday % 7); + } + printf(") "); } printf("(%dd) ", scalar.tm_yday); } -- cgit 1.4.1 ='master' selected='selected'>master dontfiles
summary refs log tree commit diff
path: root/bin/dash/src/var.c (unfollow)
Commit message (Collapse)Author
2021-01-19Map tags to IDs using only [[:alnum:]-._]June McEnroe
2021-01-19Don't use a pager if reading standard inputJune McEnroe
2021-01-19Support BSD make syntax and match *.amJune McEnroe
These don't really go together, but...
2021-01-19Match tab following escaped newline in make assignmentsJune McEnroe
Otherwise it ends up going into Shell state.
2021-01-18Allow matching lexers using first input lineJune McEnroe