mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +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
|
@ -41,13 +41,12 @@ int CmdStop (
|
|||
auto latest = getLatestInterval (database);
|
||||
|
||||
// Verify the interval is open.
|
||||
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 ();
|
||||
database.modifyInterval (latest, modified);
|
||||
|
||||
// User feedback.
|
||||
|
@ -65,8 +64,8 @@ int CmdStop (
|
|||
latest.tags ().size ())
|
||||
{
|
||||
// Contiguous with previous interval.
|
||||
latest.start (modified.end ());
|
||||
latest.end ({0});
|
||||
latest.range.start = modified.range.end;
|
||||
latest.range.end = Datetime (0);
|
||||
|
||||
database.addInterval (latest);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue