Skip to content

Commit

Permalink
Merge pull request #122 from mike-n-jordan/fix_js_build_for_clock
Browse files Browse the repository at this point in the history
Fix preparing timezones for date library.
  • Loading branch information
mike-n-jordan authored Oct 26, 2023
2 parents abbbe6f + 00b61c2 commit 38d342a
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 0 deletions.
5 changes: 5 additions & 0 deletions shared/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ kotlin {
implementation(kotlin("test"))
}
}
val jsMain by getting {
dependencies {
implementation(npm("@js-joda/timezone", "2.3.0"))
}
}
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package com.bumble.livemosaic.participant

actual fun prepareTimeZones() {
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ data class Time(val hours: Int, val minutes: Int, val seconds: Int)

@Composable
fun ClockWidget(modifier: Modifier = Modifier) {
prepareTimeZones()
fun currentTime(): Time {
val cal = Clock.System.now()
val dateTime: LocalDateTime = cal.toLocalDateTime(TimeZone.of("Europe/London"))
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package com.bumble.livemosaic.participant

expect fun prepareTimeZones()
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package com.bumble.livemosaic.participant

actual fun prepareTimeZones() {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package com.bumble.livemosaic.participant

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

private val jsJodaTz = JsJodaTimeZoneModule
actual fun prepareTimeZones() {
jsJodaTz
}

0 comments on commit 38d342a

Please sign in to comment.