Support durations in recurrence ending dates

When spending the end date of recurring items, allow date duration
specifiers such as "+5d" or "+3w2d".

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
This commit is contained in:
Lukas Fleischer
2016-02-25 21:31:16 +01:00
parent c34f9aba29
commit f5d8b5e021
4 changed files with 125 additions and 34 deletions

View File

@@ -256,26 +256,6 @@ static long ymd_to_scalar(unsigned year, unsigned month, unsigned day)
return scalar;
}
/*
* Used to change date by adding a certain amount of days or weeks.
* Returns 0 on success, 1 otherwise.
*/
static int date_change(struct tm *date, int delta_month, int delta_day)
{
struct tm t;
t = *date;
t.tm_mon += delta_month;
t.tm_mday += delta_day;
if (mktime(&t) == -1) {
return 1;
} else {
*date = t;
return 0;
}
}
void ui_calendar_monthly_view_cache_set_invalid(void)
{
monthly_view_cache_valid = 0;