You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
372 B
Kotlin
17 lines
372 B
Kotlin
package com.idormy.sms.forwarder.database.ext
|
|
|
|
import androidx.room.TypeConverter
|
|
import java.util.Date
|
|
|
|
@Suppress("unused")
|
|
class ConvertersDate {
|
|
@TypeConverter
|
|
fun fromTimestamp(value: Long?): Date? {
|
|
return value?.let { Date(it) }
|
|
}
|
|
|
|
@TypeConverter
|
|
fun dateToTimestamp(date: Date?): Long? {
|
|
return date?.time
|
|
}
|
|
} |