Dependency Updates

This commit is contained in:
2025-08-31 18:24:41 -06:00
parent d10622c382
commit 2e163f8354
6 changed files with 44 additions and 81 deletions

View File

@@ -2,15 +2,18 @@ package com.atridad.mealient.database
import androidx.room.TypeConverter
import kotlinx.datetime.*
import kotlin.time.ExperimentalTime
object RoomTypeConverters {
@OptIn(ExperimentalTime::class)
@TypeConverter
fun localDateTimeToTimestamp(localDateTime: LocalDateTime) =
localDateTime.toInstant(TimeZone.UTC).toEpochMilliseconds()
@OptIn(ExperimentalTime::class)
@TypeConverter
fun timestampToLocalDateTime(timestamp: Long) =
Instant.fromEpochMilliseconds(timestamp).toLocalDateTime(TimeZone.UTC)
kotlin.time.Instant.fromEpochMilliseconds(timestamp).toLocalDateTime(TimeZone.UTC)
@TypeConverter
fun localDateToTimeStamp(date: LocalDate) =