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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user