mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
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:
parent
6ef5650129
commit
da5e2925ad
2 changed files with 7 additions and 4 deletions
|
@ -11,6 +11,8 @@
|
||||||
non-existent task (thanks to Peter De Poorter).
|
non-existent task (thanks to Peter De Poorter).
|
||||||
+ Fixed bug #529, where the 'depends' attribute was not mentioned in the
|
+ Fixed bug #529, where the 'depends' attribute was not mentioned in the
|
||||||
task man page (thanks to Dirk Deimeke).
|
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
|
+ Fixed bug #535 which omitted the holidays-NO.rc file from the packages
|
||||||
(thanks to Jostein Berntsen).
|
(thanks to Jostein Berntsen).
|
||||||
+ Fixed bug #537, where the man page task-sync(5) mis-specified some URIs.
|
+ 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);
|
return Date (m, d, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (period == "weekdays")
|
else if (period == "weekdays")
|
||||||
{
|
{
|
||||||
int dow = current.dayOfWeek ();
|
int dow = current.dayOfWeek ();
|
||||||
int days;
|
int days;
|
||||||
|
@ -235,7 +235,7 @@ Date getNextRecurrence (Date& current, std::string& period)
|
||||||
return current + (days * 86400);
|
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);
|
std::string numeric = period.substr (0, period.length () - 1);
|
||||||
int increment = atoi (numeric.c_str ());
|
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 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;
|
int secs = 0;
|
||||||
try { Duration du (period); secs = du; }
|
Duration du (period);
|
||||||
catch (...) { secs = 0; }
|
secs = du;
|
||||||
|
|
||||||
return current + secs;
|
return current + secs;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue