Bug #530
- Fixed bug #530, where unrecognized periods on recurring tasks were not being properly handled (thanks to T. Charles Yun).
This commit is contained in:
@@ -11,6 +11,8 @@
|
||||
non-existent task (thanks to Peter De Poorter).
|
||||
+ Fixed bug #529, where the 'depends' attribute was not mentioned in the
|
||||
task man page (thanks to Dirk Deimeke).
|
||||
+ Fixed bug #530, where unrecognized periods on recurring tasks were not
|
||||
being properly handled (thanks to T. Charles Yun).
|
||||
+ Fixed bug #535 which omitted the holidays-NO.rc file from the packages
|
||||
(thanks to Jostein Berntsen).
|
||||
+ Fixed bug #537, where the man page task-sync(5) mis-specified some URIs.
|
||||
|
||||
@@ -223,7 +223,7 @@ Date getNextRecurrence (Date& current, std::string& period)
|
||||
return Date (m, d, y);
|
||||
}
|
||||
|
||||
if (period == "weekdays")
|
||||
else if (period == "weekdays")
|
||||
{
|
||||
int dow = current.dayOfWeek ();
|
||||
int days;
|
||||
@@ -235,7 +235,7 @@ Date getNextRecurrence (Date& current, std::string& period)
|
||||
return current + (days * 86400);
|
||||
}
|
||||
|
||||
if (isdigit (period[0]) && period[period.length () - 1] == 'm')
|
||||
else if (isdigit (period[0]) && period[period.length () - 1] == 'm')
|
||||
{
|
||||
std::string numeric = period.substr (0, period.length () - 1);
|
||||
int increment = atoi (numeric.c_str ());
|
||||
@@ -338,9 +338,10 @@ Date getNextRecurrence (Date& current, std::string& period)
|
||||
}
|
||||
|
||||
// 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.
|
||||
int secs = 0;
|
||||
try { Duration du (period); secs = du; }
|
||||
catch (...) { secs = 0; }
|
||||
Duration du (period);
|
||||
secs = du;
|
||||
|
||||
return current + secs;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user