diff options
author | John Keeping | 2016-01-19 19:33:07 +0000 |
---|---|---|
committer | Jason A. Donenfeld | 2016-02-08 14:23:02 +0100 |
commit | eb80b4edadd07957f667f057c82875c30a822a1f (patch) | |
tree | 2bf96367ef64e5dc5a1843ac521868efb23dd94d | |
parent | ui-shared: use show_date for footer timestamp (diff) | |
download | cgit-eb80b4edadd07957f667f057c82875c30a822a1f.tar.gz cgit-eb80b4edadd07957f667f057c82875c30a822a1f.zip |
ui-atom: use show_date directly for atom dates
This will allow us to remove cgit_print_date and use Git's show_date consistently. Signed-off-by: John Keeping <john@keeping.me.uk>
-rw-r--r-- | ui-atom.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/ui-atom.c b/ui-atom.c index 11ea0c0..0bf2cf2 100644 --- a/ui-atom.c +++ b/ui-atom.c | |||
@@ -17,6 +17,11 @@ static void add_entry(struct commit *commit, const char *host) | |||
17 | char *hex; | 17 | char *hex; |
18 | char *mail, *t, *t2; | 18 | char *mail, *t, *t2; |
19 | struct commitinfo *info; | 19 | struct commitinfo *info; |
20 | struct date_mode mode = { | ||
21 | .type = DATE_STRFTIME, | ||
22 | .strftime_fmt = FMT_ATOMDATE, | ||
23 | .local = 0, | ||
24 | }; | ||
20 | 25 | ||
21 | info = cgit_parse_commit(commit); | 26 | info = cgit_parse_commit(commit); |
22 | hex = oid_to_hex(&commit->object.oid); | 27 | hex = oid_to_hex(&commit->object.oid); |
@@ -25,7 +30,7 @@ static void add_entry(struct commit *commit, const char *host) | |||
25 | html_txt(info->subject); | 30 | html_txt(info->subject); |
26 | html("</title>\n"); | 31 | html("</title>\n"); |
27 | html("<updated>"); | 32 | html("<updated>"); |
28 | cgit_print_date(info->committer_date, FMT_ATOMDATE, 0); | 33 | html_txt(show_date(info->committer_date, 0, &mode)); |
29 | html("</updated>\n"); | 34 | html("</updated>\n"); |
30 | html("<author>\n"); | 35 | html("<author>\n"); |
31 | if (info->author) { | 36 | if (info->author) { |
@@ -50,7 +55,7 @@ static void add_entry(struct commit *commit, const char *host) | |||
50 | } | 55 | } |
51 | html("</author>\n"); | 56 | html("</author>\n"); |
52 | html("<published>"); | 57 | html("<published>"); |
53 | cgit_print_date(info->author_date, FMT_ATOMDATE, 0); | 58 | html_txt(show_date(info->author_date, 0, &mode)); |
54 | html("</published>\n"); | 59 | html("</published>\n"); |
55 | if (host) { | 60 | if (host) { |
56 | char *pageurl; | 61 | char *pageurl; |