Skip to content

Commit e6f720f

Browse files
committed
Add a note about timezone DB dependency in Kotlin/JS
Fixes #71
1 parent 3076ba6 commit e6f720f

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,34 @@ dependencies {
283283
}
284284
```
285285

286+
#### Note about time zones in JS
287+
288+
By default, there's only one time zone available in Kotlin/JS: the `SYSTEM` time zone with a fixed offset.
289+
290+
If you want to use all time zones in Kotlin/JS platform, you need to add the following npm dependency:
291+
292+
```kotlin
293+
kotlin {
294+
sourceSets {
295+
val jsMain by getting {
296+
dependencies {
297+
implementation(npm("@js-joda/timezone", "2.3.0"))
298+
}
299+
}
300+
}
301+
}
302+
```
303+
304+
and after that add the following initialization code in your project:
305+
306+
```kotlin
307+
@JsModule("@js-joda/timezone")
308+
@JsNonModule
309+
external object JsJodaTimeZoneModule
310+
311+
private val jsJodaTz = JsJodaTimeZoneModule
312+
```
313+
286314
### Maven
287315

288316
- Add the bintray repository to the `<repositories>` section.

0 commit comments

Comments
 (0)