all repos — cgit @ b44dd95f13f039cd9bee301655150ff765d9555e

a hyperfast web frontend for git written in c

ui-shared: use common function in print_rel_date()

Signed-off-by: John Keeping <john@keeping.me.uk>
John Keeping john@keeping.me.uk
Thu, 13 Aug 2015 12:24:33 +0100
commit

b44dd95f13f039cd9bee301655150ff765d9555e

parent

f03e3cb8a5c6b597b87321e1f082d3ab177e8baa

1 files changed, 1 insertions(+), 10 deletions(-)

jump to
M ui-shared.cui-shared.c

@@ -627,17 +627,8 @@

static void print_rel_date(time_t t, double value, const char *class, const char *suffix) { - char buf[64]; - struct tm *time; - - if (ctx.cfg.local_time) - time = localtime(&t); - else - time = gmtime(&t); - strftime(buf, sizeof(buf) - 1, FMT_LONGDATE, time); - htmlf("<span class='%s' title='", class); - html_attr(buf); + html_attr(fmt_date(t, FMT_LONGDATE, ctx.cfg.local_time)); htmlf("'>%.0f %s</span>", value, suffix); }