List for cgit developers and users
 help / color / mirror / Atom feed
From: john at keeping.me.uk (John Keeping)
Subject: [PATCH 7/8] ui-atom: use show_date directly for atom dates
Date: Tue, 19 Jan 2016 19:33:07 +0000	[thread overview]
Message-ID: <a2abbc5f5e12a6d7974f669aeeb3c1aea2bdc923.1453231719.git.john@keeping.me.uk> (raw)
In-Reply-To: <cover.1453231719.git.john@keeping.me.uk>

This will allow us to remove cgit_print_date and use Git's show_date
consistently.

Signed-off-by: John Keeping <john at keeping.me.uk>
---
 ui-atom.c | 9 +++++++--
 1 file 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)
 	char *hex;
 	char *mail, *t, *t2;
 	struct commitinfo *info;
+	struct date_mode mode = {
+		.type = DATE_STRFTIME,
+		.strftime_fmt = FMT_ATOMDATE,
+		.local = 0,
+	};
 
 	info = cgit_parse_commit(commit);
 	hex = oid_to_hex(&commit->object.oid);
@@ -25,7 +30,7 @@ static void add_entry(struct commit *commit, const char *host)
 	html_txt(info->subject);
 	html("</title>\n");
 	html("<updated>");
-	cgit_print_date(info->committer_date, FMT_ATOMDATE, 0);
+	html_txt(show_date(info->committer_date, 0, &mode));
 	html("</updated>\n");
 	html("<author>\n");
 	if (info->author) {
@@ -50,7 +55,7 @@ static void add_entry(struct commit *commit, const char *host)
 	}
 	html("</author>\n");
 	html("<published>");
-	cgit_print_date(info->author_date, FMT_ATOMDATE, 0);
+	html_txt(show_date(info->author_date, 0, &mode));
 	html("</published>\n");
 	if (host) {
 		char *pageurl;
-- 
2.7.0.226.gfe986fe



  parent reply	other threads:[~2016-01-19 19:33 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-19 19:33 [PATCH 0/8] Show times in the originator's timezone john
2016-01-19 19:33 ` [PATCH 1/8] ui-shared: remove "format" from cgit_print_age() john
2016-01-19 19:33 ` [PATCH 2/8] parsing: add timezone to ident structures john
2016-01-19 19:33 ` [PATCH 3/8] ui-shared: add cgit_date_mode() john
2016-02-08 13:20   ` Jason
2016-02-08 13:23     ` Jason
2016-01-19 19:33 ` [PATCH 4/8] ui-{commit,tag}: show dates in originator's timezone john
2016-01-19 19:33 ` [PATCH 5/8] ui: show ages in the " john
2016-01-19 19:33 ` [PATCH 6/8] ui-shared: use show_date for footer timestamp john
2016-01-19 19:33 ` john [this message]
2016-01-19 19:33 ` [PATCH 8/8] ui-shared: remove cgit_print_date() john
2016-02-08 13:23 ` [PATCH 0/8] Show times in the originator's timezone Jason
2016-02-08 13:38   ` Jason
2016-02-08 14:08     ` john
2016-02-08 14:33       ` Jason
2016-02-08 15:05         ` [PATCH 1/2] Avoid DATE_STRFTIME for long/short dates john
2016-02-08 15:06           ` [PATCH 2/2] ui-atom: avoid DATE_STRFTIME john

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a2abbc5f5e12a6d7974f669aeeb3c1aea2bdc923.1453231719.git.john@keeping.me.uk \
    --to=cgit@lists.zx2c4.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).