From 607a9e8aaa9b1a18f81ae67e40a5c8a5d1a92577 Mon Sep 17 00:00:00 2001 From: David Reiss Date: Thu, 27 Aug 2009 16:39:38 -0700 Subject: [PATCH] Round-down years in "years+months" relative date view Previously, a commit from 1 year and 7 months ago would display as "2 years, 7 months ago". Signed-off-by: David Reiss Signed-off-by: Junio C Hamano --- date.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/date.c b/date.c index 409a17d46..f011692c2 100644 --- a/date.c +++ b/date.c @@ -135,7 +135,7 @@ const char *show_date(unsigned long time, int tz, enum date_mode mode) } /* Give years and months for 5 years or so */ if (diff < 1825) { - unsigned long years = (diff + 183) / 365; + unsigned long years = diff / 365; unsigned long months = (diff % 365 + 15) / 30; int n; n = snprintf(timebuf, sizeof(timebuf), "%lu year%s", -- 2.30.2