mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-24 18:06:42 +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.
|
// Assume the ordinal is 1, but look for an integer, just in case.
|
||||||
double value = 1;
|
double value = 1;
|
||||||
Nibbler n (lower_input);
|
Nibbler n (lower_input);
|
||||||
n.skipAll (' ');
|
|
||||||
n.getNumber (value);
|
n.getNumber (value);
|
||||||
n.skipAll (' ');
|
|
||||||
|
|
||||||
if (value < 0.0)
|
if (value < 0.0)
|
||||||
value = -value;
|
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.
|
// Assume the ordinal is 1, but look for an integer, just in case.
|
||||||
double value = 1;
|
double value = 1;
|
||||||
Nibbler n (lower_input);
|
Nibbler n (lower_input);
|
||||||
n.skipAll (' ');
|
|
||||||
n.getNumber (value);
|
n.getNumber (value);
|
||||||
|
|
||||||
n.skipAll (' ');
|
|
||||||
|
|
||||||
if (value < 0.0)
|
if (value < 0.0)
|
||||||
{
|
{
|
||||||
mNegative = true;
|
mNegative = true;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue