mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Recurrence
- Task::validate and getNextRecurrence needed to consider both Duration and ISO8601p.
This commit is contained in:
parent
6d5d93d753
commit
87dcbd556e
2 changed files with 28 additions and 5 deletions
14
src/Task.cpp
14
src/Task.cpp
|
@ -55,6 +55,7 @@
|
|||
#include <Variant.h>
|
||||
#include <Filter.h>
|
||||
#include <Dates.h>
|
||||
#include <ISO8601.h>
|
||||
|
||||
#define APPROACHING_INFINITY 1000 // Close enough. This isn't rocket surgery.
|
||||
|
||||
|
@ -1574,10 +1575,17 @@ void Task::validate (bool applyDefault /* = true */)
|
|||
// Recur durations must be valid.
|
||||
if (has ("recur"))
|
||||
{
|
||||
Duration d;
|
||||
std::string value = get ("recur");
|
||||
|
||||
ISO8601p p;
|
||||
std::string::size_type i = 0;
|
||||
if (! d.parse (get ("recur"), i))
|
||||
throw std::string (format (STRING_TASK_VALID_RECUR, get ("recur")));
|
||||
if (! p.parse (value, i))
|
||||
{
|
||||
i = 0;
|
||||
Duration d;
|
||||
if (! d.parse (value, i))
|
||||
throw std::string (format (STRING_TASK_VALID_RECUR, value));
|
||||
}
|
||||
}
|
||||
|
||||
// Priorities must be valid.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue