Revert "Do not create recurring tasks before today (#3542)" (#3555)

This reverts commit 6d3519419e.
This commit is contained in:
Dustin J. Mitchell 2024-07-13 19:12:49 -04:00 committed by GitHub
parent 9db275fedb
commit d4649dd210
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 33 additions and 44 deletions

View file

@ -135,10 +135,9 @@ void handleRecurrence ()
////////////////////////////////////////////////////////////////////////////////
// Determine a start date (due), an optional end date (until), and an increment
// period (recur). Then generate a set of corresponding dates. Only recurrences
// in the future are returned; see #3501.
// period (recur). Then generate a set of corresponding dates.
//
// Returns false if the parent recurring task is deleted.
// Returns false if the parent recurring task is depleted.
bool generateDueDates (Task& parent, std::vector <Datetime>& allDue)
{
// Determine due date, recur period and until date.
@ -159,12 +158,9 @@ bool generateDueDates (Task& parent, std::vector <Datetime>& allDue)
auto recurrence_limit = Context::getContext ().config.getInteger ("recurrence.limit");
int recurrence_counter = 0;
Datetime now;
Datetime today = now.startOfDay();
for (Datetime i = due; ; i = getNextRecurrence (i, recur))
{
// Do not add tasks before today (but allow today for the common `due:today` form).
if (i >= today)
allDue.push_back (i);
allDue.push_back (i);
if (specificEnd && i > until)
{