commit c5812c127f7b9f7c1027cc31fb72d2e1b002aa3d
parent 70838abe942dedc20f50cab1efe11491b91906a7
Author: Matthias Beyer <mail@beyermatthias.de>
Date: Mon, 28 Nov 2016 19:31:36 +0100
Outsource date format string into define
Diffstat:
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/diary.c b/diary.c
@@ -9,6 +9,8 @@ struct app_state {
struct tm cal_end;
};
+#define DATE_FMT "%Y-%m-%d"
+
void setup_cal_timeframe(struct app_state* s)
{
s->raw_time = time(NULL);
@@ -223,7 +225,7 @@ bool is_leap(int year)
void get_date_str(struct tm* date, char* date_str, size_t date_str_size)
{
- strftime(date_str, date_str_size, "%Y-%m-%d", date);
+ strftime(date_str, date_str_size, DATE_FMT, date);
}
void fpath(char* dir, size_t dir_size, struct tm* date, char* rpath, size_t rpath_size)