Unit tests are on the android side.
This commit is contained in:
@ -16,18 +16,10 @@ actual class DateUtils actual constructor(actual val appSettingsService: AppSett
|
||||
val FORMATTERV1 = "yyyy-MM-dd HH:mm:ss"
|
||||
|
||||
return if (appSettingsService.getApiVersion() >= 4) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
OffsetDateTime.parse(dateString).toInstant().toEpochMilli()
|
||||
} else {
|
||||
TODO("VERSION.SDK_INT < O")
|
||||
}
|
||||
OffsetDateTime.parse(dateString).toInstant().toEpochMilli()
|
||||
} else {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
LocalDateTime.parse(dateString, DateTimeFormatter.ofPattern(FORMATTERV1)).toInstant(
|
||||
ZoneOffset.UTC).toEpochMilli()
|
||||
} else {
|
||||
TODO("VERSION.SDK_INT < O")
|
||||
}
|
||||
LocalDateTime.parse(dateString, DateTimeFormatter.ofPattern(FORMATTERV1)).toInstant(
|
||||
ZoneOffset.UTC).toEpochMilli()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2,13 +2,12 @@ package bou.amine.apps.readerforselfossv2.DI
|
||||
|
||||
import bou.amine.apps.readerforselfossv2.rest.SelfossApi
|
||||
import bou.amine.apps.readerforselfossv2.service.AppSettingsService
|
||||
import com.russhwolf.settings.Settings
|
||||
import org.kodein.di.DI
|
||||
import org.kodein.di.bind
|
||||
import org.kodein.di.instance
|
||||
import org.kodein.di.singleton
|
||||
|
||||
val networkModule by DI.Module {
|
||||
bind<AppSettingsService>() with singleton { AppSettingsService(Settings()) }
|
||||
bind<AppSettingsService>() with singleton { AppSettingsService() }
|
||||
bind<SelfossApi>() with singleton { SelfossApi(instance()) }
|
||||
}
|
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user