mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +02:00
helper: Renamed and retyped intervalsFromHolidays to rangesFromHolidays
This commit is contained in:
parent
878585dd79
commit
ff14c553ad
2 changed files with 7 additions and 7 deletions
|
@ -401,20 +401,20 @@ std::string jsonFromIntervals (const std::vector <Interval>& intervals)
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
std::vector <Interval> intervalsFromHolidays (const Rules& rules)
|
std::vector <Daterange> rangesFromHolidays (const Rules& rules)
|
||||||
{
|
{
|
||||||
std::vector <Interval> results;
|
std::vector <Daterange> results;
|
||||||
for (auto& holiday : rules.all ("holidays."))
|
for (auto& holiday : rules.all ("holidays."))
|
||||||
{
|
{
|
||||||
auto lastDot = holiday.rfind ('.');
|
auto lastDot = holiday.rfind ('.');
|
||||||
if (lastDot != std::string::npos)
|
if (lastDot != std::string::npos)
|
||||||
{
|
{
|
||||||
Interval h;
|
Daterange r;
|
||||||
Datetime d (holiday.substr (lastDot + 1), "Y_M_D");
|
Datetime d (holiday.substr (lastDot + 1), "Y_M_D");
|
||||||
h.start (d);
|
r.start (d);
|
||||||
++d;
|
++d;
|
||||||
h.end (d);
|
r.end (d);
|
||||||
results.push_back (h);
|
results.push_back (r);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -54,7 +54,7 @@ Timeline createTimelineFromData (const Rules&, Database&, const Filter&);
|
||||||
Interval getLatestInterval (Database&);
|
Interval getLatestInterval (Database&);
|
||||||
bool intervalMatchesFilter (const Interval&, const Filter&);
|
bool intervalMatchesFilter (const Interval&, const Filter&);
|
||||||
std::string jsonFromIntervals (const std::vector <Interval>&);
|
std::string jsonFromIntervals (const std::vector <Interval>&);
|
||||||
std::vector <Interval> intervalsFromHolidays (const Rules&);
|
std::vector <Daterange> rangesFromHolidays (const Rules&);
|
||||||
|
|
||||||
// utiŀ.cpp
|
// utiŀ.cpp
|
||||||
std::string osName ();
|
std::string osName ();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue