mirror of
https://git.zx2c4.com/cgit
synced 2024-11-25 18:08:41 +00:00
ui-shared: use common function in print_rel_date()
Signed-off-by: John Keeping <john@keeping.me.uk>
This commit is contained in:
parent
f03e3cb8a5
commit
b44dd95f13
11
ui-shared.c
11
ui-shared.c
@ -627,17 +627,8 @@ void cgit_print_date(time_t secs, const char *format, int local_time)
|
|||||||
static void print_rel_date(time_t t, double value,
|
static void print_rel_date(time_t t, double value,
|
||||||
const char *class, const char *suffix)
|
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);
|
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);
|
htmlf("'>%.0f %s</span>", value, suffix);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user