mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
Recurring Tasks - new "weekdays" frequency
- Added support for "weekdays" as a recurrence frequency, which skips Saturday and Sunday, but is otherwise a daily recurrence. Thanks to Chris Pride.
This commit is contained in:
parent
3c196230dd
commit
3d3d788961
8 changed files with 249 additions and 164 deletions
12
src/task.cpp
12
src/task.cpp
|
@ -565,6 +565,18 @@ Date getNextRecurrence (Date& current, std::string& period)
|
|||
return Date (m, d, y);
|
||||
}
|
||||
|
||||
if (period == "weekdays")
|
||||
{
|
||||
int dow = current.dayOfWeek ();
|
||||
int days;
|
||||
|
||||
if (dow == 5) days = 3;
|
||||
else if (dow == 6) days = 2;
|
||||
else days = 1;
|
||||
|
||||
return current + (days * 86400);
|
||||
}
|
||||
|
||||
if (isdigit (period[0]) && period[period.length () - 1] == 'm')
|
||||
{
|
||||
std::string numeric = period.substr (0, period.length () - 1);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue