From 000a751e6b753e8817006a25ba5c9b05ebca7578 Mon Sep 17 00:00:00 2001 From: Christophe Beyls Date: Sun, 26 May 2024 15:32:02 +0200 Subject: [PATCH] chore: remove unused DateUtils method --- app/src/main/java/be/digitalia/fosdem/utils/DateUtils.kt | 9 --------- 1 file changed, 9 deletions(-) diff --git a/app/src/main/java/be/digitalia/fosdem/utils/DateUtils.kt b/app/src/main/java/be/digitalia/fosdem/utils/DateUtils.kt index 5a526069..0b0b1d55 100644 --- a/app/src/main/java/be/digitalia/fosdem/utils/DateUtils.kt +++ b/app/src/main/java/be/digitalia/fosdem/utils/DateUtils.kt @@ -6,7 +6,6 @@ import androidx.core.os.ConfigurationCompat import java.time.Instant import java.time.LocalDateTime import java.time.ZoneId -import java.time.ZoneOffset import java.time.format.DateTimeFormatter object DateUtils { @@ -20,12 +19,4 @@ object DateUtils { fun Instant.toLocalDateTime(zoneId: ZoneId): LocalDateTime { return LocalDateTime.ofInstant(this, zoneId) -} - -/** - * Convert to Instant without allocating intermediate objects if possible. - */ -fun LocalDateTime.toInstant(zoneId: ZoneId): Instant { - val zoneOffset = if (zoneId is ZoneOffset) zoneId else zoneId.rules.getOffset(this) - return toInstant(zoneOffset) } \ No newline at end of file