diff --git a/composeApp/src/androidMain/kotlin/steps/notifer/app/HealthConnectHelper.kt b/composeApp/src/androidMain/kotlin/steps/notifer/app/HealthConnectHelper.kt index fc56342..77f02f8 100644 --- a/composeApp/src/androidMain/kotlin/steps/notifer/app/HealthConnectHelper.kt +++ b/composeApp/src/androidMain/kotlin/steps/notifer/app/HealthConnectHelper.kt @@ -164,8 +164,10 @@ object HealthConnectHelper { } private fun todayRange(): Pair { - val startOfDay = LocalDate.now().atStartOfDay(ZoneId.systemDefault()).toInstant() + val zone = ZoneId.systemDefault() val now = Instant.now() - return startOfDay to now + val startOfDay = now.atZone(zone).toLocalDate().atStartOfDay(zone).toInstant() + val endTime = maxOf(now, startOfDay.plusSeconds(1)) + return startOfDay to endTime } -} \ No newline at end of file +}