summary refs log tree commit diff
path: root/bin
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2021-12-03 15:51:06 -0500
committerJune McEnroe <june@causal.agency>2021-12-03 15:51:06 -0500
commit9810c8dd3052c696ffeb4b4ae239cae745bea619 (patch)
treef9c2715dfb28f375256c48a5436dca140dca6cfa /bin
parentAdd Six Months, Three Days, Five Others (diff)
downloadsrc-9810c8dd3052c696ffeb4b4ae239cae745bea619.tar.gz
src-9810c8dd3052c696ffeb4b4ae239cae745bea619.zip
Show weeks plus days
Diffstat (limited to 'bin')
-rw-r--r--bin/when.y8
1 files 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);
 	}
ref='/src/commit/bin/man1/hi.1?id=2f03c36531f9b70e8200d3ea17b68a1ca27a4224&follow=1'>Add IRC output to hiJune McEnroe 2019-02-07Improve C syntax accuracy and add Format classJune McEnroe 2019-02-07Factor out hi checkJune McEnroe 2019-02-07Add Escape class to hiJune McEnroe 2019-02-07Add Todo class and parent syntax constraintJune McEnroe