Skip to content

Mention Wasm/JS timezone database support in README #470

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 10, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,33 @@ external object JsJodaTimeZoneModule
private val jsJodaTz = JsJodaTimeZoneModule
```

#### Note about time zones in Wasm/JS

Wasm/JS uses the same time zone support as JS, so almost the same instructions apply.

In your Gradle build script, add the following dependency:

```kotlin
kotlin {
sourceSets {
val wasmJsMain by getting {
dependencies {
implementation(npm("@js-joda/timezone", "2.3.0"))
}
}
}
}
```

and after that add the following initialization code in your project:

```kotlin
@JsModule("@js-joda/timezone")
external object JsJodaTimeZoneModule

private val jsJodaTz = JsJodaTimeZoneModule
```

#### Note about time zones in Wasm/WASI

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