diff options
| author | Bryce Kwon <bryce@brycekwon.com> | |
|---|---|---|
| committer | Bryce Kwon <bryce@brycekwon.com> | |
| commit | ||
| parent | ||
| tree | ||
| download | ||
Wrap the dates in time elements
Diffstat (limited to '')
| -rw-r--r-- | source/ui-commit.c | 6 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -rw-r--r-- | source/ui-shared.c | 15 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -rw-r--r-- | source/ui-tag.c | 7 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
3 files changed, 21 insertions, 7 deletions
diff --git a/source/ui-commit.c b/source/ui-commit.c index 4838210..5a71954 100644 --- a/source/ui-commit.c +++ b/source/ui-commit.c @@ -34,9 +34,11 @@ static void print_ident_row(const char *role, const char *name, html_txt(email); } cgit_close_filter(ctx.repo->email_filter); - html("</td><td class='right'>"); + html("</td><td class='right'><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("</td></tr>\n"); + html("</time></td></tr>\n"); } static int print_parent_rows(struct commit *commit, const char *rev, diff --git a/source/ui-shared.c b/source/ui-shared.c index 7a2255e..1f45520 100644 --- a/source/ui-shared.c +++ b/source/ui-shared.c @@ -289,9 +289,16 @@ static struct date_mode configured_date_mode(void) return mode; } +/* + * Dates render as time elements, whose datetime attribute wants the strict + * ISO 8601 form with the T separator rather than the space git prints by + * default. + */ static void print_abs_date(time_t t, int tz) { - html("<span title='"); + html("<time datetime='"); + html_attr(show_date(t, tz, cgit_date_mode(DATE_ISO8601_STRICT))); + html("' title='"); html_attr(show_date(t, tz, cgit_date_mode(DATE_ISO8601))); html("'>"); html_txt(show_date(t, tz, configured_date_mode())); @@ -301,9 +308,11 @@ static void print_abs_date(time_t t, int tz) static void print_rel_date(time_t t, int tz, double count, const char *class, const char *suffix) { - htmlf("<span class='%s' data-ut='%" PRIu64 "' title='", class, (uint64_t)t); + htmlf("<time class='%s' datetime='", class); + html_attr(show_date(t, tz, cgit_date_mode(DATE_ISO8601_STRICT))); + htmlf("' data-ut='%" PRIu64 "' title='", (uint64_t)t); html_attr(show_date(t, tz, cgit_date_mode(DATE_ISO8601))); - htmlf("'>%.0f %s</span>", count, suffix); + htmlf("'>%.0f %s</time>", count, suffix); } static char *http_date(time_t t) diff --git a/source/ui-tag.c b/source/ui-tag.c index 7020ed7..8bfbd8e 100644 --- a/source/ui-tag.c +++ b/source/ui-tag.c @@ -75,10 +75,13 @@ static void print_annotated_tag(const char *revname, html_txt(revname); htmlf(" (<span class='oid'>%s</span>)</td></tr>\n", oid_to_hex(oid)); if (info->tagger_date > 0) { - html("<tr><th>tag date</th><td>"); + html("<tr><th>tag date</th><td><time datetime='"); + html_attr(show_date(info->tagger_date, info->tagger_tz, + cgit_date_mode(DATE_ISO8601_STRICT))); + html("'>"); html_txt(show_date(info->tagger_date, info->tagger_tz, cgit_date_mode(DATE_ISO8601))); - html("</td></tr>\n"); + html("</time></td></tr>\n"); } if (info->tagger) { html("<tr><th>tagged by</th><td>"); |
