From a49adf2db7cfb3e4b12fed948c76205a42f334cd Mon Sep 17 00:00:00 2001 From: mercurialmoon Date: Wed, 23 Dec 2020 19:15:05 -0800 Subject: Allow configuration of appointment time format Added the option to configure the format in which appointment time is displayed. The setting is called "format.appointmenttime" under the general settings menu. Setting defaults to previous behavior, which was "%H:%M". Signed-off-by: mercurialmoon Signed-off-by: Lukas Fleischer --- src/apoint.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/apoint.c') diff --git a/src/apoint.c b/src/apoint.c index 4cb77f6..b4e8f2e 100644 --- a/src/apoint.c +++ b/src/apoint.c @@ -42,6 +42,8 @@ #include "calcurse.h" #include "sha1.h" +#define APPT_TIME_LENGTH 25 + llist_ts_t alist_p; void apoint_free(struct apoint *apt) @@ -134,16 +136,14 @@ void apoint_sec2str(struct apoint *o, time_t day, char *start, char *end) } else { t = o->start; localtime_r(&t, <); - snprintf(start, HRMIN_SIZE, "%02u:%02u", lt.tm_hour, - lt.tm_min); + strftime(start, APPT_TIME_LENGTH, conf.timefmt, <); } if (o->start + o->dur > day + DAYLEN(day)) { strncpy(end, "..:..", 6); } else { t = o->start + o->dur; localtime_r(&t, <); - snprintf(end, HRMIN_SIZE, "%02u:%02u", lt.tm_hour, - lt.tm_min); + strftime(end, APPT_TIME_LENGTH, conf.timefmt, <); } } -- cgit v1.2.3-54-g00ecf