diff --git a/src/data.cpp b/src/data.cpp index d4b860d3..86732513 100644 --- a/src/data.cpp +++ b/src/data.cpp @@ -62,7 +62,8 @@ Interval getFilter (const CLI& cli) if (arg.hasTag ("HINT")) { - if (expandIntervalHint (canonical, start, end)) + Range dummy; + if (expandIntervalHint (canonical, dummy)) { args.push_back (""); args.push_back ("-"); diff --git a/src/helper.cpp b/src/helper.cpp index 08fc2f6f..3d99e984 100644 --- a/src/helper.cpp +++ b/src/helper.cpp @@ -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 > 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; diff --git a/src/timew.h b/src/timew.h index 61179447..33418395 100644 --- a/src/timew.h +++ b/src/timew.h @@ -65,7 +65,7 @@ int dispatchCommand (const CLI&, Database&, Rules&, const Extensions&); // helper.cpp Color tagColor (const Rules&, const std::string&); std::string intervalSummarize (Database&, const Rules&, const Interval&); -bool expandIntervalHint (const std::string&, std::string&, std::string&); +bool expandIntervalHint (const std::string&, Range&); std::string jsonFromIntervals (const std::vector &); Palette createPalette (const Rules&); std::map createTagColorMap (const Rules&, Palette&, const std::vector &);