mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-06-26 10:54:28 +02:00
helper: Changed ::expandIntervalHint to operate on a range
This commit is contained in:
parent
98899acc4d
commit
13d73a0e6d
3 changed files with 8 additions and 8 deletions
|
@ -108,8 +108,7 @@ std::string intervalSummarize (
|
|||
// Convert a set of hints to equivalent date ranges.
|
||||
bool expandIntervalHint (
|
||||
const std::string& hint,
|
||||
std::string& start,
|
||||
std::string& end)
|
||||
Range& range)
|
||||
{
|
||||
static std::map <std::string, std::vector <std::string>> hints
|
||||
{
|
||||
|
@ -124,8 +123,8 @@ bool expandIntervalHint (
|
|||
// Some hints are just synonyms.
|
||||
if (hints.find (hint) != hints.end ())
|
||||
{
|
||||
start = hints[hint][0];
|
||||
end = hints[hint][1];
|
||||
range.start = Datetime (hints[hint][0]);
|
||||
range.end = Datetime (hints[hint][1]);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -136,8 +135,8 @@ bool expandIntervalHint (
|
|||
Datetime eocw ("eocw");
|
||||
socw -= 7 * 86400;
|
||||
eocw -= 7 * 86400;
|
||||
start = socw.toString ("Y-M-D");
|
||||
end = eocw.toString ("Y-M-D");
|
||||
range.start = Datetime (socw.toString ("Y-M-D"));
|
||||
range.end = Datetime (eocw.toString ("Y-M-D"));
|
||||
}
|
||||
|
||||
return false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue