mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +02:00
CmdCancel: Simplified code
This commit is contained in:
parent
990117a4c9
commit
b8eb23ceef
1 changed files with 2 additions and 3 deletions
|
@ -35,10 +35,9 @@ int CmdCancel (
|
||||||
Rules& rules,
|
Rules& rules,
|
||||||
Database& database)
|
Database& database)
|
||||||
{
|
{
|
||||||
// If there is an open interval, cancel it.
|
// If there is an open interval, cancel it by deleting it..
|
||||||
auto latest = getLatestInterval (database);
|
auto latest = getLatestInterval (database);
|
||||||
if ( latest.range.started () &&
|
if (latest.range.open ())
|
||||||
! latest.range.ended ())
|
|
||||||
{
|
{
|
||||||
database.deleteInterval (latest);
|
database.deleteInterval (latest);
|
||||||
if (rules.getBoolean ("verbose"))
|
if (rules.getBoolean ("verbose"))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue