File tree Expand file tree Collapse file tree 3 files changed +8
-4
lines changed
src/commonMain/kotlin/com/jetbrains/greeting/greetingkmp Expand file tree Collapse file tree 3 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -32,10 +32,13 @@ kotlin {
32
32
33
33
sourceSets {
34
34
all {
35
- languageSettings.optIn(" kotlin.experimental.ExperimentalObjCName" )
35
+ languageSettings {
36
+ optIn(" kotlin.experimental.ExperimentalObjCName" )
37
+ optIn(" kotlin.time.ExperimentalTime" )
38
+ }
36
39
}
37
40
commonMain.dependencies {
38
- implementation(" org.jetbrains.kotlinx:kotlinx-datetime:0.6.2 " )
41
+ implementation(" org.jetbrains.kotlinx:kotlinx-datetime:0.7.0 " )
39
42
implementation(" org.jetbrains.kotlinx:kotlinx-coroutines-core:1.10.2" )
40
43
implementation(" io.ktor:ktor-client-core:${ktorVersion} " )
41
44
implementation(" io.ktor:ktor-client-content-negotiation:${ktorVersion} " )
Original file line number Diff line number Diff line change 1
1
package com.jetbrains.greeting.greetingkmp
2
2
3
3
import kotlinx.datetime.*
4
+ import kotlin.time.Clock
4
5
5
6
fun daysUntilNewYear (): Int {
6
7
val today = Clock .System .todayIn(TimeZone .currentSystemDefault())
Original file line number Diff line number Diff line change @@ -5,10 +5,10 @@ import io.ktor.client.call.body
5
5
import io.ktor.client.plugins.contentnegotiation.*
6
6
import io.ktor.client.request.get
7
7
import io.ktor.serialization.kotlinx.json.*
8
- import kotlinx.datetime.Instant
9
8
import kotlinx.datetime.TimeZone
10
9
import kotlinx.datetime.toLocalDateTime
11
10
import kotlinx.serialization.json.Json
11
+ import kotlin.time.Instant
12
12
13
13
class RocketComponent {
14
14
private val httpClient = HttpClient {
@@ -28,7 +28,7 @@ class RocketComponent {
28
28
val date = Instant .parse(lastSuccessLaunch.launchDateUTC)
29
29
.toLocalDateTime(TimeZone .currentSystemDefault())
30
30
31
- return " ${date.month} ${date.dayOfMonth } , ${date.year} "
31
+ return " ${date.month} ${date.day } , ${date.year} "
32
32
}
33
33
34
34
suspend fun launchPhrase (): String =
You can’t perform that action at this time.
0 commit comments