Skip to content

Commit

Permalink
Mention Wasm/JS timezone database support in README
Browse files Browse the repository at this point in the history
Fixes #469
  • Loading branch information
dkhalanskyjb committed Jan 8, 2025
1 parent b289d0b commit fdf9f75
Showing 1 changed file with 27 additions and 0 deletions.
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

0 comments on commit fdf9f75

Please sign in to comment.