Skip to content

Commit

Permalink
chore: remove unused DateUtils method
Browse files Browse the repository at this point in the history
  • Loading branch information
cbeyls committed May 26, 2024
1 parent 42e5beb commit 000a751
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions app/src/main/java/be/digitalia/fosdem/utils/DateUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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)
}

0 comments on commit 000a751

Please sign in to comment.