diff options
-rw-r--r-- | ui-shared.c | 9 | ||||
-rw-r--r-- | ui-shared.h | 1 |
2 files changed, 10 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 | ||
630 | const 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 | |||
630 | static void print_rel_date(time_t t, double value, | 639 | static 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 | { |
diff --git a/ui-shared.h b/ui-shared.h index c9413ed..707cec9 100644 --- a/ui-shared.h +++ b/ui-shared.h | |||
@@ -61,6 +61,7 @@ __attribute__((format (printf,1,2))) | |||
61 | extern void cgit_print_error(const char *fmt, ...); | 61 | extern void cgit_print_error(const char *fmt, ...); |
62 | __attribute__((format (printf,1,0))) | 62 | __attribute__((format (printf,1,0))) |
63 | extern void cgit_vprint_error(const char *fmt, va_list ap); | 63 | extern void cgit_vprint_error(const char *fmt, va_list ap); |
64 | extern const struct date_mode *cgit_date_mode(const char *format); | ||
64 | extern void cgit_print_date(time_t secs, const char *format, int local_time); | 65 | extern void cgit_print_date(time_t secs, const char *format, int local_time); |
65 | extern void cgit_print_age(time_t t, time_t max_relative); | 66 | extern void cgit_print_age(time_t t, time_t max_relative); |
66 | extern void cgit_print_http_headers(void); | 67 | extern void cgit_print_http_headers(void); |