mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
Expressions
- Variants can now construct dates and duration from std::string.
This commit is contained in:
parent
aea1c8fea6
commit
2b135ed3c2
1 changed files with 15 additions and 2 deletions
|
@ -590,8 +590,21 @@ void Variant::input (const std::string& input)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO Attempt Date (input) parse.
|
// Attempt Date (input) parse.
|
||||||
// TODO Attempt Duration (input) parse.
|
if (Date::valid (input, context.config.get ("dateformat")))
|
||||||
|
{
|
||||||
|
_type = v_date;
|
||||||
|
_date = Date (input);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Attempt Duration (input) parse.
|
||||||
|
if (Duration::valid (input))
|
||||||
|
{
|
||||||
|
_type = v_duration;
|
||||||
|
_duration = Duration (input);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
bool numeric = true;
|
bool numeric = true;
|
||||||
bool period = false;
|
bool period = false;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue