mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +02:00
libshared: Accomodated new argument order for Datetime
This commit is contained in:
parent
a7ffd46122
commit
24bb8ade7a
4 changed files with 20 additions and 20 deletions
|
@ -232,7 +232,7 @@ std::vector <Range> Database::segmentRange (const Range& range)
|
|||
(start_y == end_y && start_m <= end_m))
|
||||
{
|
||||
// Capture date before incrementing month.
|
||||
Datetime segmentStart (start_m, 1, start_y);
|
||||
Datetime segmentStart (start_y, start_m, 1);
|
||||
|
||||
// Next month.
|
||||
start_m += 1;
|
||||
|
@ -243,7 +243,7 @@ std::vector <Range> Database::segmentRange (const Range& range)
|
|||
}
|
||||
|
||||
// Capture date after incrementing month.
|
||||
Datetime segmentEnd (start_m, 1, start_y);
|
||||
Datetime segmentEnd (start_y, start_m, 1);
|
||||
segments.push_back (Range (segmentStart, segmentEnd));
|
||||
}
|
||||
|
||||
|
|
|
@ -42,14 +42,14 @@ void Datafile::initialize (const std::string& name)
|
|||
auto month = strtol (basename.substr (5, 2).c_str (), NULL, 10);
|
||||
|
||||
// The range is a month: [start, end).
|
||||
Datetime start (month, 1, year, 0, 0, 0);
|
||||
Datetime start (year, month, 1, 0, 0, 0);
|
||||
month++;
|
||||
if (month > 12)
|
||||
{
|
||||
year++;
|
||||
month = 1;
|
||||
}
|
||||
Datetime end (month, 1, year, 0, 0, 0);
|
||||
Datetime end (year, month, 1, 0, 0, 0);
|
||||
_range = Range (start, end);
|
||||
}
|
||||
|
||||
|
|
|
@ -163,7 +163,7 @@ Range Exclusion::rangeFromTimeBlock (
|
|||
{
|
||||
int hh, mm, ss;
|
||||
if (pig.getHMS (hh, mm, ss))
|
||||
return Range (start, Datetime (start.month (), start.day (), start.year (), hh, mm, ss));
|
||||
return Range (start, Datetime (start.year (), start.month (), start.day (), hh, mm, ss));
|
||||
|
||||
throw format ("Malformed time block '{1}'.", block);
|
||||
}
|
||||
|
@ -171,7 +171,7 @@ Range Exclusion::rangeFromTimeBlock (
|
|||
{
|
||||
int hh, mm, ss;
|
||||
if (pig.getHMS (hh, mm, ss))
|
||||
return Range (Datetime (start.month (), start.day (), start.year (), hh, mm, ss), end);
|
||||
return Range (Datetime (start.year (), start.month (), start.day (), hh, mm, ss), end);
|
||||
|
||||
throw format ("Malformed time block '{1}'.", block);
|
||||
}
|
||||
|
@ -182,8 +182,8 @@ Range Exclusion::rangeFromTimeBlock (
|
|||
pig.skip ('-') &&
|
||||
pig.getHMS (hh2, mm2, ss2))
|
||||
return Range (
|
||||
Datetime (start.month (), start.day (), start.year (), hh1, mm1, ss1),
|
||||
Datetime (start.month (), start.day (), start.year (), hh2, mm2, ss2));
|
||||
Datetime (start.year (), start.month (), start.day (), hh1, mm1, ss1),
|
||||
Datetime (start.year (), start.month (), start.day (), hh2, mm2, ss2));
|
||||
|
||||
throw format ("Malformed time block '{1}'.", block);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue