From 4627543c2f5387f0178b6766cf9c856e2352cc73 Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Sat, 5 Jun 2021 12:20:13 -0400 Subject: Show number of weeks for scalar if even --- bin/when.y | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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"); } -- cgit 1.4.1 on> dontfiles
summary refs log tree commit diff
path: root/bin/1sh/mail.c (unfollow)
Commit message (Expand)Author
2020-06-08Replace __FBSDID macros with commentsJune McEnroe
2020-06-08Remove reference to FreeBSD-specific libedit hackJune McEnroe
2020-06-08Prefix mandoc with exec in about-filterJune McEnroe
2020-06-07Remove mktemp options from mkbuiltins, mktokensJune McEnroe
2020-06-07Cast z_stream fields to size_tJune McEnroe
2020-06-07Call static_assert by _Static_assertJune McEnroe
2020-06-07Add OpenBSD to install.shJune McEnroe
2020-06-03Add The Song of AchillesJune McEnroe
2020-06-01Allow redirecting input in everJune McEnroe
2020-05-31Add %c conversion to c scriptJune McEnroe
2020-05-31Add c script to READMEJune McEnroe
2020-05-31Add c scriptJune McEnroe
2020-05-31Update mdoc source URLsJune McEnroe
2020-05-26Remove unfinished PSF fontsJune McEnroe