mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Feature #298 - Configurable recurring task count
- Added new recurrence.limit value (default 1) to control the number of future pending tasks generated from a recurring parent task. - Added unit tests. - Updated taskrc man page.
This commit is contained in:
parent
78d092c588
commit
bb19361956
6 changed files with 79 additions and 1 deletions
|
@ -156,6 +156,8 @@ bool generateDueDates (Task& parent, std::vector <Date>& allDue)
|
|||
specificEnd = true;
|
||||
}
|
||||
|
||||
int recurrence_limit = context.config.getInteger ("recurrence.limit");
|
||||
int recurrence_counter = 0;
|
||||
Date now;
|
||||
for (Date i = due; ; i = getNextRecurrence (i, recur))
|
||||
{
|
||||
|
@ -175,6 +177,9 @@ bool generateDueDates (Task& parent, std::vector <Date>& allDue)
|
|||
}
|
||||
|
||||
if (i > now)
|
||||
++recurrence_counter;
|
||||
|
||||
if (recurrence_counter >= recurrence_limit)
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue