mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Durations
- Removed support for ' 1 wk', namely spaces before and after the ordinal. This removes (some) ambiguity in more complex command lines. - Fixed unit tests accordingly.
This commit is contained in:
parent
501953a6da
commit
6ed2bcd605
2 changed files with 94 additions and 99 deletions
|
@ -338,9 +338,7 @@ bool Duration::valid (const std::string& input)
|
|||
// Assume the ordinal is 1, but look for an integer, just in case.
|
||||
double value = 1;
|
||||
Nibbler n (lower_input);
|
||||
n.skipAll (' ');
|
||||
n.getNumber (value);
|
||||
n.skipAll (' ');
|
||||
|
||||
if (value < 0.0)
|
||||
value = -value;
|
||||
|
@ -377,11 +375,8 @@ void Duration::parse (const std::string& input)
|
|||
// Assume the ordinal is 1, but look for an integer, just in case.
|
||||
double value = 1;
|
||||
Nibbler n (lower_input);
|
||||
n.skipAll (' ');
|
||||
n.getNumber (value);
|
||||
|
||||
n.skipAll (' ');
|
||||
|
||||
if (value < 0.0)
|
||||
{
|
||||
mNegative = true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue