about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorJohn Keeping2015-08-13 12:24:34 +0100
committerJason A. Donenfeld2015-08-13 15:40:27 +0200
commita360666df3cfcd1b384cd66b18803d72e3893b3d (patch)
tree5950113ff058451591ea83aa9939eaad5cf38e77
parentui-shared: use common function in print_rel_date() (diff)
downloadcgit-a360666df3cfcd1b384cd66b18803d72e3893b3d.tar.gz
cgit-a360666df3cfcd1b384cd66b18803d72e3893b3d.zip
ui-shared: show full date in tooltip if longer ago than max_relative
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>
-rw-r--r--ui-shared.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/ui-shared.c b/ui-shared.c index bbb277a..36fcb21 100644 --- a/ui-shared.c +++ b/ui-shared.c
@@ -644,7 +644,11 @@ void cgit_print_age(time_t t, time_t max_relative, const char *format)
644 secs = 0; 644 secs = 0;
645 645
646 if (secs > max_relative && max_relative >= 0) { 646 if (secs > max_relative && max_relative >= 0) {
647 html("<span title='");
648 html_attr(fmt_date(t, FMT_LONGDATE, ctx.cfg.local_time));
649 html("'>");
647 cgit_print_date(t, format, ctx.cfg.local_time); 650 cgit_print_date(t, format, ctx.cfg.local_time);
651 html("</span>");
648 return; 652 return;
649 } 653 }
650 654