summaryrefslogtreecommitdiffhomepage
path: root/android/lib/model/src
diff options
context:
space:
mode:
authorKalle Lindström <karl.lindstrom@mullvad.net>2025-02-25 10:48:50 +0100
committerKalle Lindström <karl.lindstrom@mullvad.net>2025-02-26 09:25:17 +0100
commitda304ffedf8f8d98600f31f737cf92768c0323fa (patch)
treee8da9b9a861f3d3efbbbc39fb5160ec1cfeb67fa /android/lib/model/src
parent5025db74b34cfb3536c43f89f3407ffc0d97ae73 (diff)
downloadmullvadvpn-da304ffedf8f8d98600f31f737cf92768c0323fa.tar.xz
mullvadvpn-da304ffedf8f8d98600f31f737cf92768c0323fa.zip
Remove Joda Time and use java.time package instead
Joda Time has been superseded by the Java 8 java.time package which has more or less the same API. This commit removes all usage of Joda Time and replaces it with the java.time classes. This is done so that we can remove the dependency on Joda Time.
Diffstat (limited to 'android/lib/model/src')
-rw-r--r--android/lib/model/src/main/kotlin/net/mullvad/mullvadvpn/lib/model/AccountData.kt4
-rw-r--r--android/lib/model/src/main/kotlin/net/mullvad/mullvadvpn/lib/model/Device.kt4
-rw-r--r--android/lib/model/src/main/kotlin/net/mullvad/mullvadvpn/lib/model/Notification.kt2
-rw-r--r--android/lib/model/src/main/kotlin/net/mullvad/mullvadvpn/lib/model/RedeemVoucherSuccess.kt4
4 files changed, 7 insertions, 7 deletions
diff --git a/android/lib/model/src/main/kotlin/net/mullvad/mullvadvpn/lib/model/AccountData.kt b/android/lib/model/src/main/kotlin/net/mullvad/mullvadvpn/lib/model/AccountData.kt
index 8a4182b2e5..b1746e1bcc 100644
--- a/android/lib/model/src/main/kotlin/net/mullvad/mullvadvpn/lib/model/AccountData.kt
+++ b/android/lib/model/src/main/kotlin/net/mullvad/mullvadvpn/lib/model/AccountData.kt
@@ -1,5 +1,5 @@
package net.mullvad.mullvadvpn.lib.model
-import org.joda.time.DateTime
+import java.time.ZonedDateTime
-data class AccountData(val id: AccountId, val expiryDate: DateTime)
+data class AccountData(val id: AccountId, val expiryDate: ZonedDateTime)
diff --git a/android/lib/model/src/main/kotlin/net/mullvad/mullvadvpn/lib/model/Device.kt b/android/lib/model/src/main/kotlin/net/mullvad/mullvadvpn/lib/model/Device.kt
index e8303f0eca..3eb92f2f8f 100644
--- a/android/lib/model/src/main/kotlin/net/mullvad/mullvadvpn/lib/model/Device.kt
+++ b/android/lib/model/src/main/kotlin/net/mullvad/mullvadvpn/lib/model/Device.kt
@@ -1,12 +1,12 @@
package net.mullvad.mullvadvpn.lib.model
import android.os.Parcelable
+import java.time.ZonedDateTime
import kotlinx.parcelize.Parcelize
import net.mullvad.mullvadvpn.lib.model.extensions.startCase
-import org.joda.time.DateTime
@Parcelize
-data class Device(val id: DeviceId, private val name: String, val creationDate: DateTime) :
+data class Device(val id: DeviceId, private val name: String, val creationDate: ZonedDateTime) :
Parcelable {
fun displayName(): String = name.startCase()
}
diff --git a/android/lib/model/src/main/kotlin/net/mullvad/mullvadvpn/lib/model/Notification.kt b/android/lib/model/src/main/kotlin/net/mullvad/mullvadvpn/lib/model/Notification.kt
index acb8d74907..6b073988a3 100644
--- a/android/lib/model/src/main/kotlin/net/mullvad/mullvadvpn/lib/model/Notification.kt
+++ b/android/lib/model/src/main/kotlin/net/mullvad/mullvadvpn/lib/model/Notification.kt
@@ -1,6 +1,6 @@
package net.mullvad.mullvadvpn.lib.model
-import org.joda.time.Duration
+import java.time.Duration
sealed interface Notification {
val actions: List<NotificationAction>
diff --git a/android/lib/model/src/main/kotlin/net/mullvad/mullvadvpn/lib/model/RedeemVoucherSuccess.kt b/android/lib/model/src/main/kotlin/net/mullvad/mullvadvpn/lib/model/RedeemVoucherSuccess.kt
index 9c81042b8c..53fa414047 100644
--- a/android/lib/model/src/main/kotlin/net/mullvad/mullvadvpn/lib/model/RedeemVoucherSuccess.kt
+++ b/android/lib/model/src/main/kotlin/net/mullvad/mullvadvpn/lib/model/RedeemVoucherSuccess.kt
@@ -1,5 +1,5 @@
package net.mullvad.mullvadvpn.lib.model
-import org.joda.time.DateTime
+import java.time.ZonedDateTime
-data class RedeemVoucherSuccess(val timeAdded: Long, val newExpiryDate: DateTime)
+data class RedeemVoucherSuccess(val timeAdded: Long, val newExpiryDate: ZonedDateTime)