Skip to content

Commit 3720474

Browse files
authored
Mention Wasm/JS timezone database support in README (#470)
Fixes #469
1 parent 52902bd commit 3720474

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

README.md

+27
Original file line numberDiff line numberDiff line change
@@ -478,6 +478,33 @@ external object JsJodaTimeZoneModule
478478
private val jsJodaTz = JsJodaTimeZoneModule
479479
```
480480

481+
#### Note about time zones in Wasm/JS
482+
483+
Wasm/JS uses the same time zone support as JS, so almost the same instructions apply.
484+
485+
In your Gradle build script, add the following dependency:
486+
487+
```kotlin
488+
kotlin {
489+
sourceSets {
490+
val wasmJsMain by getting {
491+
dependencies {
492+
implementation(npm("@js-joda/timezone", "2.3.0"))
493+
}
494+
}
495+
}
496+
}
497+
```
498+
499+
and after that add the following initialization code in your project:
500+
501+
```kotlin
502+
@JsModule("@js-joda/timezone")
503+
external object JsJodaTimeZoneModule
504+
505+
private val jsJodaTz = JsJodaTimeZoneModule
506+
```
507+
481508
#### Note about time zones in Wasm/WASI
482509

483510
By default, there's only one time zone available in Kotlin/Wasm WASI: the `UTC` time zone with a fixed offset.

0 commit comments

Comments
 (0)