From 360af46fac6fe79ec1868141a6c34b4c6b732ba0 Mon Sep 17 00:00:00 2001
From: John Keeping <john@keeping.me.uk>
Date: Tue, 19 Jan 2016 19:33:03 +0000
Subject: ui-shared: add cgit_date_mode()

This returns the correct mode value for use with Git's show_date() based
on the current CGit configuration and will be used in the following
patches.

Signed-off-by: John Keeping <john@keeping.me.uk>
---
 ui-shared.c | 9 +++++++++
 1 file changed, 9 insertions(+)

(limited to 'ui-shared.c')

diff --git a/ui-shared.c b/ui-shared.c
index 76aac60..923d102 100644
--- a/ui-shared.c
+++ b/ui-shared.c
@@ -627,6 +627,15 @@ void cgit_print_date(time_t secs, const char *format, int local_time)
 	html_txt(fmt_date(secs, format, local_time));
 }
 
+const struct date_mode *cgit_date_mode(const char *format)
+{
+	static struct date_mode mode;
+	mode.type = DATE_STRFTIME;
+	mode.strftime_fmt = format;
+	mode.local = ctx.cfg.local_time;
+	return &mode;
+}
+
 static void print_rel_date(time_t t, double value,
 	const char *class, const char *suffix)
 {
-- 
cgit 1.4.1-3-g733a5