aboutsummaryrefslogtreecommitdiffstats
path: root/ui-shared.c
diff options
context:
space:
mode:
authorJohn Keeping2016-01-19 19:33:03 +0000
committerJason A. Donenfeld2016-02-08 14:21:34 +0100
commit360af46fac6fe79ec1868141a6c34b4c6b732ba0 (patch)
treed0fad8a5d40e6d1ab371d14ad0695838e936fcea /ui-shared.c
parent45c87ca1c32dcd5ffd4a681fadf05627d9ce7770 (diff)
downloadcgit-360af46fac6fe79ec1868141a6c34b4c6b732ba0.tar.gz
cgit-360af46fac6fe79ec1868141a6c34b4c6b732ba0.tar.bz2
cgit-360af46fac6fe79ec1868141a6c34b4c6b732ba0.zip
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>
Diffstat (limited to 'ui-shared.c')
-rw-r--r--ui-shared.c9
1 files changed, 9 insertions, 0 deletions
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)
627 html_txt(fmt_date(secs, format, local_time)); 627 html_txt(fmt_date(secs, format, local_time));
628} 628}
629 629
630const struct date_mode *cgit_date_mode(const char *format)
631{
632 static struct date_mode mode;
633 mode.type = DATE_STRFTIME;
634 mode.strftime_fmt = format;
635 mode.local = ctx.cfg.local_time;
636 return &mode;
637}
638
630static void print_rel_date(time_t t, double value, 639static void print_rel_date(time_t t, double value,
631 const char *class, const char *suffix) 640 const char *class, const char *suffix)
632{ 641{