diff options
| -rw-r--r-- | assets/cgit.css | 24 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -rw-r--r-- | source/ui-commit.c | 6 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -rw-r--r-- | source/ui-shared.c | 15 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -rw-r--r-- | source/ui-tag.c | 7 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
4 files changed, 33 insertions, 19 deletions
diff --git a/assets/cgit.css b/assets/cgit.css index 5f6ad42..dbf76e9 100644 --- a/assets/cgit.css +++ b/assets/cgit.css @@ -1099,37 +1099,37 @@ div#cgit ul.pager .current { /* Ages / line counts */ -div#cgit span.age-mins, -div#cgit span.age-hours, -div#cgit span.age-days, -div#cgit span.age-weeks, -div#cgit span.age-months, -div#cgit span.age-years { +div#cgit time.age-mins, +div#cgit time.age-hours, +div#cgit time.age-days, +div#cgit time.age-weeks, +div#cgit time.age-months, +div#cgit time.age-years { white-space: nowrap; } -div#cgit span.age-mins { +div#cgit time.age-mins { font-weight: bold; color: var(--age-mins); } -div#cgit span.age-hours { +div#cgit time.age-hours { color: var(--age-hours); } -div#cgit span.age-days { +div#cgit time.age-days { color: var(--age-days); } -div#cgit span.age-weeks { +div#cgit time.age-weeks { color: var(--age-weeks); } -div#cgit span.age-months { +div#cgit time.age-months { color: var(--age-months); } -div#cgit span.age-years { +div#cgit time.age-years { color: var(--age-years); } 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>"); |
