mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-06-26 10:54:28 +02:00
Interval: Now has pubic ::range, which has public ::start, ::end
This commit is contained in:
parent
7fe116f75a
commit
63a6255412
17 changed files with 413 additions and 506 deletions
|
@ -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 ();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue