<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kukuri.git/modules/orgflow-ui/src/androidMain, branch main</title>
<subtitle>kukuri: Kotlin Multiplatform app (desktop / wasm / native / Android) for the orgflow UI</subtitle>
<link rel='alternate' type='text/html' href='https://openpgpkey.dangofactory.net/cgit/cgit.cgi/kukuri.git/'/>
<entry>
<title>UI: stop calling kotlinx-datetime's now()/todayIn() - it cannot link on Wasm</title>
<updated>2026-09-24T08:47:52+00:00</updated>
<author>
<name>Charlie Root</name>
<email>root@dangofactory.local</email>
</author>
<published>2026-09-24T08:47:52+00:00</published>
<link rel='alternate' type='text/html' href='https://openpgpkey.dangofactory.net/cgit/cgit.cgi/kukuri.git/commit/?id=481f8dde4dde37dce726ba3dc2815b13202620f4'/>
<id>481f8dde4dde37dce726ba3dc2815b13202620f4</id>
<content type='text'>
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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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.
</pre>
</div>
</content>
</entry>
</feed>
