Include start day in error message for recurrence rule

Signed-off-by: Lars Henriksen <LarsHenriksen@get2net.dk>
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
This commit is contained in:
Lars Henriksen
2020-05-23 21:12:44 +02:00
committed by Lukas Fleischer
parent 61a743c56a
commit 92dc069fc4
4 changed files with 36 additions and 12 deletions

View File

@@ -2067,3 +2067,19 @@ int wday_per_month(int month, int year, int weekday)
return last_wday / 7 + (last_wday % 7 > 0);
}
/*
* Return allocated string with day of 't' inserted in 'template' in the user's
* preferred format; template must be a "printf" template with exactly one
* string conversion (%s).
*/
char *day_ins(char **template, time_t t)
{
char *day, *msg;
day = date_sec2date_str(update_time_in_date(t, 0 , 0),
DATEFMT(conf.input_datefmt));
asprintf(&msg, *template, day);
mem_free(day);
return msg;
}