[PATCH] Added code to output the age as seconds instead of "0 min."

Luke San Antonio lsworkemail112 at gmail.com
Sat Aug 18 22:37:15 CEST 2012


---
 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("<span class='age-mins'>%.0f sec.</span>",
+		      secs * 1.0);
+		return;
+	}
 	if (secs < TM_HOUR * 2) {
 		htmlf("<span class='age-mins'>%.0f min.</span>",
 		      secs * 1.0 / TM_MIN);
-- 
1.7.12-rc0





More information about the CGit mailing list