summaryrefslogtreecommitdiff
path: root/modules/orgflow-ui/src/androidMain/kotlin/jp
AgeCommit message (Collapse)Author
2026-09-24UI: stop calling kotlinx-datetime's now()/todayIn() - it cannot link on WasmCharlie Root
The UI still died at startup, now with a different symbol: IrLinkageError: Function 'now' can not be called: No function found for symbol 'com.kizitonwose.calendar.core/now|now@kotlinx.datetime.LocalDate.Companion( kotlin.time.Clock;kotlinx.datetime.TimeZone){}[0]' So replacing the calendar library's YearMonth.now() with LocalDate.now() was not a fix - it only moved the failure one level down. Every now/todayIn entry point in this stack is declared as taking a kotlin.time.Clock, and that symbol does not resolve in this combination (Kotlin 2.1.21 + kotlinx-datetime 0.7.1 + Compose MP 1.8.2, Wasm target). kotlin.time.Clock only becomes usable in later Kotlin versions, and kotlinx-datetime 0.7 is built against that newer shape. Get "today" from the platform instead: a new expect/actual todayLocalDate() with one actual per target - JS Date on wasmJs, Clock.System.todayIn() on jvm and android (where the Clock symbol does resolve). The calendar month is then built as YearMonth(year, monthNumber) from that date, which also avoids the kizitonwose Month vs kotlinx Month type clash that broke the Android compile. Wasm js(...) has its own constraint worth recording: the call must be the single expression forming a top-level function body, and the result must be a primitive/string/function - so the Date reads are folded into one arrow IIFE returning YYYYMMDD as an Int, which Kotlin then splits. Verified: compileKotlinWasmJs now passes.