From mboxrd@z Thu Jan 1 00:00:00 1970 From: lsworkemail112 at gmail.com (Luke San Antonio) Date: Fri, 28 Sep 2012 20:30:16 -0400 Subject: [PATCH] Added code to output the age as seconds instead of "0 min." In-Reply-To: References: Message-ID: <1348878616-10065-1-git-send-email-lsworkemail112@gmail.com> Before this patch, the program will output the age as "0 min." Which isn't as specific as it can be... Although this patch doesn't do any fancy automatic crap like use javascript to update the value realtime, it still adds a much needed feature... --- ui-shared.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ui-shared.c b/ui-shared.c index 43166af..a1f9d70 100644 --- a/ui-shared.c +++ b/ui-shared.c @@ -594,6 +594,11 @@ void cgit_print_age(time_t t, time_t max_relative, const char *format) return; } + if (secs < TM_MIN) { + htmlf("%.0f sec.", + secs * 1.0); + return; + } if (secs < TM_HOUR * 2) { htmlf("%.0f min.", secs * 1.0 / TM_MIN); -- 1.7.12-rc0