mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +02:00
CmdStop: Allows a specified end dateteim
This commit is contained in:
parent
b09be2b7b1
commit
07022a07dc
1 changed files with 9 additions and 1 deletions
|
@ -38,6 +38,7 @@ int CmdStop (
|
|||
Database& database)
|
||||
{
|
||||
// Load the most recent interval.
|
||||
auto filter = getFilter (cli);
|
||||
auto latest = getLatestInterval (database);
|
||||
|
||||
// Verify the interval is open.
|
||||
|
@ -45,7 +46,14 @@ int CmdStop (
|
|||
{
|
||||
// Stop it.
|
||||
Interval modified {latest};
|
||||
modified.range.end = Datetime ();
|
||||
|
||||
// If a stop date is specified (and occupies filter.range.start) then use
|
||||
// that instead of the current time.
|
||||
if (filter.range.start.toEpoch () != 0)
|
||||
modified.range.end = filter.range.start;
|
||||
else
|
||||
modified.range.end = Datetime ();
|
||||
|
||||
database.modifyInterval (latest, modified);
|
||||
/*
|
||||
// TODO There is no 1:N modifyInterval.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue