Diff options
| author | Bryce Kwon <bryce@brycekwon.com> | |
|---|---|---|
| committer | Bryce Kwon <bryce@brycekwon.com> | |
| commit | ||
| parent | ||
| tree | ||
| download | ||
Print the commit and tag dates through one helper
Diffstat (limited to '')
| -rw-r--r-- | source/ui-shared.c | 9 |
1 file changed, 9 insertions, 0 deletions
diff --git a/source/ui-shared.c b/source/ui-shared.c index 8c5e4e5..5e2a9de 100644 --- a/source/ui-shared.c +++ b/source/ui-shared.c @@ -1308,6 +1308,15 @@ void cgit_print_age(time_t t, int tz, time_t max_relative) print_rel_date(t, tz, secs * 1.0 / SECONDS_PER_YEAR, "age-years", "years"); } +void cgit_print_date(timestamp_t date, int tz) +{ + html("<time datetime='"); + html_attr(show_date(date, tz, cgit_date_mode(DATE_ISO8601_STRICT))); + html("'>"); + html_txt(show_date(date, tz, cgit_date_mode(DATE_ISO8601))); + html("</time>"); +} + void cgit_print_person(const char *name, const char *email, const char *origin, int show_email) { cgit_open_filter(ctx.repo->email_filter, email ? email : "", origin); |
