Skip to content

Commit 29c863a

Browse files
authored
Merge pull request #729 from JetBrains/ktl-1474-datetime
KTL-1474 Add kotlinx-datetime to the Playground
2 parents b157563 + 21c4fd7 commit 29c863a

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

dependencies/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ dependencies {
102102
kotlinDependency("org.jetbrains.kotlin:kotlin-test:$kotlinVersion")
103103
kotlinDependency("org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.7.3")
104104
kotlinDependency("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.6.4")
105+
kotlinDependency("org.jetbrains.kotlinx:kotlinx-datetime:0.6.0-RC.2")
105106
kotlinJsDependency("org.jetbrains.kotlin:kotlin-stdlib-js:$kotlinVersion")
106107
kotlinJsDependency("org.jetbrains.kotlin:kotlin-dom-api-compat:$kotlinVersion")
107108
kotlinWasmDependency("org.jetbrains.kotlin:kotlin-stdlib-wasm-js:$kotlinVersion")
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package com.compiler.server
2+
3+
import com.compiler.server.base.BaseExecutorTest
4+
import org.junit.jupiter.api.Test
5+
6+
class DatetimeRunnerTest : BaseExecutorTest() {
7+
@Test
8+
fun `kotlinx datetime basic test`() {
9+
run(
10+
code = """
11+
import kotlinx.datetime.*
12+
13+
fun main() {
14+
val zone = TimeZone.of("Europe/Berlin")
15+
val today = Clock.System.todayIn(zone)
16+
println(today.year in 2000..3000)
17+
}
18+
""".trimIndent(),
19+
contains = "true"
20+
)
21+
}
22+
23+
}

0 commit comments

Comments
 (0)