html_txt(fmt_date(secs, format, local_time));
}
+const struct date_mode *cgit_date_mode(const char *format)
+{
+ static struct date_mode mode;
+ mode.type = DATE_STRFTIME;
+ mode.strftime_fmt = format;
+ mode.local = ctx.cfg.local_time;
+ return &mode;
+}
+
static void print_rel_date(time_t t, double value,
const char *class, const char *suffix)
{
htmlf("'>%.0f %s</span>", value, suffix);
}
-void cgit_print_age(time_t t, time_t max_relative, const char *format)
+void cgit_print_age(time_t t, time_t max_relative)
{
time_t now, secs;
html("<span title='");
html_attr(fmt_date(t, FMT_LONGDATE, ctx.cfg.local_time));
html("'>");
- cgit_print_date(t, format, ctx.cfg.local_time);
+ cgit_print_date(t, FMT_SHORTDATE, ctx.cfg.local_time);
html("</span>");
return;
}