diff --git a/src/model/time_entry.cc b/src/model/time_entry.cc index 996835f308..98f8d48667 100644 --- a/src/model/time_entry.cc +++ b/src/model/time_entry.cc @@ -490,9 +490,12 @@ void TimeEntry::LoadFromJSON(const Json::Value &data, bool syncServer) { if (!updateMergeableProperty("tid", TID)) SetTID(0, false); updateMergeableProperty("billable", Billable); - updateMergeableProperty("duration", DurationInSeconds); updateMergeablePropertyConvert("start", StartTime, convertTimeString); updateMergeablePropertyConvert("stop", StopTime, convertTimeString); + if (StopTime() == 0) + SetDurationInSeconds(-StartTime(), false); + else + updateMergeableProperty("duration", DurationInSeconds); // These properties are not sync-server-mergeable SetDurOnly(data["duronly"].asBool());