]> granicus.if.org Git - cgit/commitdiff
ui-shared: show full date in tooltip if longer ago than max_relative
authorJohn Keeping <john@keeping.me.uk>
Thu, 13 Aug 2015 11:24:34 +0000 (12:24 +0100)
committerJason A. Donenfeld <Jason@zx2c4.com>
Thu, 13 Aug 2015 13:40:27 +0000 (15:40 +0200)
Commit caed6cb (ui-shared: show absolute time in tooltip for relative
dates, 2014-12-20) added a toolip when we show a relative time.

However, in some cases we show a short date (that is, the date but not
the time) if an event was sufficiently far in the past and that commit
did not update that case to add the same tooltip.

Signed-off-by: John Keeping <john@keeping.me.uk>
ui-shared.c

index bbb277afec66f6465ceb08bab6472f96f441324e..36fcb212296dd9f0800103a6d035862c2d09fb11 100644 (file)
@@ -644,7 +644,11 @@ void cgit_print_age(time_t t, time_t max_relative, const char *format)
                secs = 0;
 
        if (secs > max_relative && max_relative >= 0) {
+               html("<span title='");
+               html_attr(fmt_date(t, FMT_LONGDATE, ctx.cfg.local_time));
+               html("'>");
                cgit_print_date(t, format, ctx.cfg.local_time);
+               html("</span>");
                return;
        }