mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +02:00
helper: Added createIntervalFromFilter
This commit is contained in:
parent
3216a8dd4f
commit
5ff46b90f3
2 changed files with 14 additions and 0 deletions
|
@ -152,6 +152,19 @@ Filter createFilterFromCLI (const CLI& cli)
|
|||
return filter;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
Interval createIntervalFromFilter (const Filter& filter)
|
||||
{
|
||||
Interval interval;
|
||||
interval.start (filter.start ());
|
||||
interval.end (filter.end ());
|
||||
|
||||
for (auto& tag : filter.tags ())
|
||||
interval.tag (tag);
|
||||
|
||||
return interval;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// The five different overlap possibilities:
|
||||
//
|
||||
|
|
|
@ -49,6 +49,7 @@ Color tagColor (const Rules&, const std::string&);
|
|||
std::string intervalSummarize (const Rules&, const Interval&);
|
||||
bool expandIntervalHint (const std::string&, std::string&, std::string&);
|
||||
Filter createFilterFromCLI (const CLI&);
|
||||
Interval createIntervalFromFilter (const Filter&);
|
||||
Timeline createTimelineFromData (const Rules&, Database&, const Filter&);
|
||||
Interval getLatestInterval (Database&);
|
||||
bool intervalMatchesFilter (const Interval&, const Filter&);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue