summary refs log tree commit diff
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
commit4627543c2f5387f0178b6766cf9c856e2352cc73 (patch)
tree4f9422307ec9d3230e96428a03896991e534eb54
parentMerge commit '5213546273ee798369ff594ad60077f1bef4655e' (diff)
downloadsrc-4627543c2f5387f0178b6766cf9c856e2352cc73.tar.gz
src-4627543c2f5387f0178b6766cf9c856e2352cc73.zip
Show number of weeks for scalar if even
-rw-r--r--bin/when.y7
1 files changed, 6 insertions, 1 deletions
diff --git a/bin/when.y b/bin/when.y
index 5367b3b3..d647d193 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");
 }
 
d>2019-09-08Set title User-AgentJune McEnroe 2019-09-07Add -x flag to titleJune McEnroe 2019-09-07Ignore SIGPIPE in relayJune McEnroe 2019-09-07Add A Memory Called EmpireJune McEnroe 2019-09-05Handle lack of Content-TypeJune McEnroe 2019-09-05Use CURLINFO_CONTENT_TYPEJune McEnroe 2019-09-05Decode entities in titlesJune McEnroe 2019-09-05Print title as soon as it's availableJune McEnroe 2019-09-05Use CURL_PREFIX to set flagsJune McEnroe 2019-09-05Add titleJune McEnroe 2019-09-04Add Avorter n'est pas tuerJune McEnroe 2019-08-29Unset executable on shell scriptsJune McEnroe 2019-08-29Add long-missing setopt to bin.7June McEnroe 2019-08-29Add editJune McEnroe