summary refs log tree commit diff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--bin/when.y7
1 files changed, 6 insertions, 1 deletions
diff --git a/bin/when.y b/bin/when.y
index bba10c40..882fe60c 100644
--- a/bin/when.y
+++ b/bin/when.y
@@ -138,7 +138,12 @@ static void printScalar(struct tm scalar) {
 	} else if (scalar.tm_mday) {
 		printf("%dw ", scalar.tm_mday / 7);
 	}
-	if (scalar.tm_yday && scalar.tm_mon) printf("(%dd) ", scalar.tm_yday);
+	if (scalar.tm_yday && scalar.tm_mon) {
+		if (scalar.tm_yday % 7 == 0) {
+			printf("(%dw) ", scalar.tm_yday / 7);
+		}
+		printf("(%dd) ", scalar.tm_yday);
+	}
 	printf("\n");
 }