- TW-1477 Incompatibility with recurring tasks created with 2.3.0 (thanks to
          David Costa).
This commit is contained in:
Paul Beckingham 2014-12-28 19:23:08 -05:00
parent d8691bc993
commit 8afdb3d8d5
3 changed files with 12 additions and 9 deletions

View file

@ -239,3 +239,4 @@ suggestions:
Nick Person Nick Person
Arnoud K Arnoud K
Ozgur Akgun Ozgur Akgun
David Costa

View file

@ -230,6 +230,8 @@
- TW-1469 Case-insensitive searching broken on Cygwin (thanks to Richard - TW-1469 Case-insensitive searching broken on Cygwin (thanks to Richard
Boß). Boß).
- TW-1471 task calc uses output it doesn't understand (thanks to Jens Erat). - TW-1471 task calc uses output it doesn't understand (thanks to Jens Erat).
- TW-1477 Incompatibility with recurring tasks created with 2.3.0 (thanks to
David Costa).
- Added new holidays.xy-XY.rc definition files - Added new holidays.xy-XY.rc definition files
- Removed deprecated 'echo.command' setting, in favor of the 'header' and - Removed deprecated 'echo.command' setting, in favor of the 'header' and
'affected' verbosity tokens. 'affected' verbosity tokens.

View file

@ -56,36 +56,36 @@ static struct
{"biyearly", 730 * DAY, true}, {"biyearly", 730 * DAY, true},
{"daily", 1 * DAY, true}, {"daily", 1 * DAY, true},
{"days", 1 * DAY, false}, {"days", 1 * DAY, false},
{"day", 1 * DAY, false}, {"day", 1 * DAY, true},
{"d", 1 * DAY, false}, {"d", 1 * DAY, false},
{"fortnight", 14 * DAY, true}, {"fortnight", 14 * DAY, true},
{"hours", 1 * HOUR, false}, {"hours", 1 * HOUR, false},
{"hour", 1 * HOUR, false}, {"hour", 1 * HOUR, true},
{"h", 1 * HOUR, false}, {"h", 1 * HOUR, false},
{"minutes", 1 * MINUTE, false}, {"minutes", 1 * MINUTE, false},
{"minute", 1 * MINUTE, false}, {"minute", 1 * MINUTE, false},
{"min", 1 * MINUTE, false}, {"min", 1 * MINUTE, false},
{"monthly", 30 * DAY, true}, {"monthly", 30 * DAY, true},
{"months", 30 * DAY, false}, {"months", 30 * DAY, false},
{"month", 30 * DAY, false}, {"month", 30 * DAY, true},
{"mo", 30 * DAY, false}, {"mo", 30 * DAY, false},
{"quarterly", 91 * DAY, true}, {"quarterly", 91 * DAY, true},
{"quarters", 91 * DAY, false}, {"quarters", 91 * DAY, false},
{"quarter", 91 * DAY, false}, {"quarter", 91 * DAY, true},
{"q", 91 * DAY, false}, {"q", 91 * DAY, false},
{"semiannual", 183 * DAY, true}, {"semiannual", 183 * DAY, true},
{"sennight", 14 * DAY, false}, {"sennight", 14 * DAY, false},
{"seconds", 1 * SECOND, false}, {"seconds", 1 * SECOND, false},
{"second", 1 * SECOND, false}, {"second", 1 * SECOND, true},
{"s", 1 * SECOND, false}, {"s", 1 * SECOND, false},
{"weekdays", 1 * DAY, true}, {"weekdays", 1 * DAY, true},
{"weekly", 7 * DAY, true}, {"weekly", 7 * DAY, true},
{"weeks", 7 * DAY, false}, {"weeks", 7 * DAY, false},
{"week", 7 * DAY, false}, {"week", 7 * DAY, true},
{"w", 7 * DAY, false}, {"w", 7 * DAY, false},
{"yearly", 365 * DAY, true}, {"yearly", 365 * DAY, true},
{"years", 365 * DAY, false}, {"years", 365 * DAY, false},
{"year", 365 * DAY, false}, {"year", 365 * DAY, true},
{"y", 365 * DAY, false}, {"y", 365 * DAY, false},
}; };
@ -284,6 +284,7 @@ bool Duration::parse (const std::string& input, std::string::size_type& start)
std::string::size_type original_start = start; std::string::size_type original_start = start;
Nibbler n (input.substr (start)); Nibbler n (input.substr (start));
// TODO This can be made static, and so preserved between calls.
std::vector <std::string> units; std::vector <std::string> units;
for (int i = 0; i < NUM_DURATIONS; i++) for (int i = 0; i < NUM_DURATIONS; i++)
units.push_back (durations[i].unit); units.push_back (durations[i].unit);
@ -327,8 +328,7 @@ bool Duration::parse (const std::string& input, std::string::size_type& start)
double seconds = 1; double seconds = 1;
for (int i = 0; i < NUM_DURATIONS; i++) for (int i = 0; i < NUM_DURATIONS; i++)
{ {
if (durations[i].unit == unit && if (durations[i].unit == unit)
durations[i].standalone == false)
{ {
seconds = durations[i].seconds; seconds = durations[i].seconds;
_secs = static_cast <int> (quantity * static_cast <double> (seconds)); _secs = static_cast <int> (quantity * static_cast <double> (seconds));