Fix parsing of "PnM" recurrence periods
Due to not accounting for the leading "P", getNextRecurrence would always return the same datetime, breaking all generic "PnM" periods and leading to an infinite loop in generateDueDates.
This commit is contained in:
committed by
Paul Beckingham
parent
e0f24c0b19
commit
7b2e68d176
@@ -251,7 +251,7 @@ Datetime getNextRecurrence (Datetime& current, std::string& period)
|
||||
Lexer::isAllDigits (period.substr (1, period.length () - 2)) &&
|
||||
period[period.length () - 1] == 'M')
|
||||
{
|
||||
int increment = strtol (period.substr (0, period.length () - 1).c_str (), nullptr, 10);
|
||||
int increment = strtol (period.substr (1, period.length () - 2).c_str (), nullptr, 10);
|
||||
|
||||
m += increment;
|
||||
while (m > 12)
|
||||
|
||||
Reference in New Issue
Block a user