From 9810c8dd3052c696ffeb4b4ae239cae745bea619 Mon Sep 17 00:00:00 2001 From: "C. 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 d647d193..ac5c7f00 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