Skip to content
This repository has been archived by the owner on Feb 13, 2024. It is now read-only.

Commit

Permalink
Duration is negative start time when TE is running (lib), #2295
Browse files Browse the repository at this point in the history
  • Loading branch information
IndrekV committed Dec 1, 2017
1 parent 1e31566 commit d2a7843
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/user.cc
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,8 @@ TimeEntry *User::Continue(

Stop();

time_t now = time(0);

TimeEntry *result = new TimeEntry();
result->SetCreatedWith(HTTPSClient::Config.UserAgent());
result->SetDescription(existing->Description());
Expand All @@ -170,10 +172,10 @@ TimeEntry *User::Continue(
result->SetBillable(existing->Billable());
result->SetTags(existing->Tags());
result->SetUID(ID());
result->SetStart(time(0));
result->SetStart(now);

if (!manual_mode) {
result->SetDurationInSeconds(-time(0));
result->SetDurationInSeconds(-now);
}

result->SetCreatedWith(HTTPSClient::Config.UserAgent());
Expand Down

0 comments on commit d2a7843

Please sign in to comment.