From ab7f0741d018ab53f66217e9f84deed90ef1110a Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Wed, 12 Aug 2015 07:52:17 -0400 Subject: [PATCH] Recurrence: Duration replaced by ISO8601p --- src/recur.cpp | 25 ++++++------------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/src/recur.cpp b/src/recur.cpp index 3267032d2..182356c91 100644 --- a/src/recur.cpp +++ b/src/recur.cpp @@ -40,7 +40,7 @@ #include #include -#include +#include #include #include #include @@ -368,27 +368,14 @@ Date getNextRecurrence (Date& current, std::string& period) return Date (m, d, y); } - // If the period is an 'easy' one, add it to current, and we're done. - // If it throws an error, the duration was not recognized. + // Add the period to current, and we're done. int secs = 0; std::string::size_type idx = 0; - Duration du; - if (du.parse (period, idx)) - { - secs = du; - } - else - { - idx = 0; - ISO8601p p; - if (p.parse (period, idx)) - { - secs = p; - } - else - throw std::string (format (STRING_TASK_VALID_RECUR, period)); - } + ISO8601p p; + if (! p.parse (period, idx)) + throw std::string (format (STRING_TASK_VALID_RECUR, period)); + secs = (time_t) p; return current + secs; }