mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +02:00
data: Added support for 'for <duration>' and removed the last use of 'since'
This commit is contained in:
parent
252a470ef8
commit
7d3fb34a87
1 changed files with 13 additions and 4 deletions
11
src/data.cpp
11
src/data.cpp
|
@ -154,7 +154,7 @@ Interval getFilter (const CLI& cli)
|
||||||
|
|
||||||
// from/since <date> for <duration>
|
// from/since <date> for <duration>
|
||||||
else if (args.size () == 4 &&
|
else if (args.size () == 4 &&
|
||||||
(args[0] == "from" || args[0] == "since") &&
|
args[0] == "from" &&
|
||||||
args[1] == "<date>" &&
|
args[1] == "<date>" &&
|
||||||
args[2] == "for" &&
|
args[2] == "for" &&
|
||||||
args[3] == "<duration>")
|
args[3] == "<duration>")
|
||||||
|
@ -192,6 +192,15 @@ Interval getFilter (const CLI& cli)
|
||||||
range.end = Datetime ();
|
range.end = Datetime ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// for <duration>
|
||||||
|
else if (args.size () == 2 &&
|
||||||
|
args[0] == "for" &&
|
||||||
|
args[1] == "<duration>")
|
||||||
|
{
|
||||||
|
range.start = Datetime () - Duration (duration).toTime_t ();
|
||||||
|
range.end = Datetime ();
|
||||||
|
}
|
||||||
|
|
||||||
// <duration>
|
// <duration>
|
||||||
else if (args.size () == 1 &&
|
else if (args.size () == 1 &&
|
||||||
args[0] == "<duration>")
|
args[0] == "<duration>")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue