summary refs log tree commit diff
path: root/bin
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2021-06-05 12:20:13 -0400
committerJune McEnroe <june@causal.agency>2021-06-08 14:36:19 -0400
commitf93f10ed62ca8c7204955aa632993a1d9b0ecb89 (patch)
tree81eb8e5b99f00e789322d6eec6875a7c7b9a3f8d /bin
parentMerge commit 'f46c4521d761a0b9909e17ef29065c0aa09c7ab7' (diff)
downloadsrc-f93f10ed62ca8c7204955aa632993a1d9b0ecb89.tar.gz
src-f93f10ed62ca8c7204955aa632993a1d9b0ecb89.zip
Show number of weeks for scalar if even
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");
 }
 
af4b855018facde4e4b02e54dd4&follow=1'>Add T suffix in bitJune McEnroe 2019-05-10Highlight yacc and lex files as CJune McEnroe 2019-05-10Use val instead of suboptargJune McEnroe 2019-05-09Add Parable of the SowerJune McEnroe 2019-05-07Add bit without buildJune McEnroe 2019-05-04Fix MANDIR typoJune McEnroe 2019-05-04Move relay to binJune McEnroe