Interval: Now has pubic ::range, which has public ::start, ::end

This commit is contained in:
Paul Beckingham 2016-04-23 10:35:06 -04:00
parent 7fe116f75a
commit 63a6255412
17 changed files with 413 additions and 506 deletions

View file

@ -40,13 +40,12 @@ int CmdStart (
auto latest = getLatestInterval (database);
// If the latest interval is open, close it.
if ( latest.isStarted () &&
! latest.isEnded ())
if ( latest.range.started () &&
! latest.range.ended ())
{
// Stop it.
Interval modified {latest};
Datetime now;
modified.end (now);
modified.range.end = Datetime ();
// Update database.
database.modifyInterval (latest, modified);
@ -58,7 +57,7 @@ int CmdStart (
// Create a new interval.
Interval now;
now.start (Datetime ());
now.range.start = Datetime ();
// Apply tags.
auto words = cli.getWords ();