diff --git a/core/src/main/java/com/example/util/simpletimetracker/core/interactor/GetUntrackedRecordsInteractorImpl.kt b/core/src/main/java/com/example/util/simpletimetracker/core/interactor/GetUntrackedRecordsInteractorImpl.kt index 0f07f51d8..a1037d23f 100644 --- a/core/src/main/java/com/example/util/simpletimetracker/core/interactor/GetUntrackedRecordsInteractorImpl.kt +++ b/core/src/main/java/com/example/util/simpletimetracker/core/interactor/GetUntrackedRecordsInteractorImpl.kt @@ -2,6 +2,7 @@ package com.example.util.simpletimetracker.core.interactor import com.example.util.simpletimetracker.core.mapper.TimeMapper import com.example.util.simpletimetracker.domain.UNTRACKED_ITEM_ID +import com.example.util.simpletimetracker.domain.extension.dropMillis import com.example.util.simpletimetracker.domain.interactor.GetUntrackedRecordsInteractor import com.example.util.simpletimetracker.domain.interactor.PrefsInteractor import com.example.util.simpletimetracker.domain.interactor.RecordInteractor @@ -29,7 +30,7 @@ class GetUntrackedRecordsInteractorImpl @Inject constructor( val minStart = recordInteractor.getNext(0)?.timeStarted ?: return emptyList() // Bound end range of calculation to current time, // to not show untracked time in the future - val maxEnd = System.currentTimeMillis() + val maxEnd = System.currentTimeMillis().dropMillis() // If range is all records - calculate from first records to current time. val actualRange = if (range.timeStarted == 0L && range.timeEnded == 0L) { diff --git a/domain/src/main/java/com/example/util/simpletimetracker/domain/model/RunningRecord.kt b/domain/src/main/java/com/example/util/simpletimetracker/domain/model/RunningRecord.kt index 598476d3c..7e94176d2 100644 --- a/domain/src/main/java/com/example/util/simpletimetracker/domain/model/RunningRecord.kt +++ b/domain/src/main/java/com/example/util/simpletimetracker/domain/model/RunningRecord.kt @@ -1,5 +1,7 @@ package com.example.util.simpletimetracker.domain.model +import com.example.util.simpletimetracker.domain.extension.dropMillis + data class RunningRecord( val id: Long, override val timeStarted: Long, @@ -8,5 +10,5 @@ data class RunningRecord( ) : RecordBase { override val typeIds: List = listOf(id) - override val timeEnded: Long get() = System.currentTimeMillis() + override val timeEnded: Long get() = System.currentTimeMillis().dropMillis() } \ No newline at end of file