@cosmicdrift/kumiko-renderer 0.156.2 → 0.156.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -3
- package/src/format-when.ts +11 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cosmicdrift/kumiko-renderer",
|
|
3
|
-
"version": "0.156.
|
|
3
|
+
"version": "0.156.3",
|
|
4
4
|
"description": "Platform-agnostic React renderer for Kumiko screens. Contains the shared logic — primitives-contract, hooks, KumikoScreen, navigation & SSE abstractions — that any platform-specific renderer (web, native) composes. No DOM, no EventSource, no react-dom.",
|
|
5
5
|
"license": "BUSL-1.1",
|
|
6
6
|
"author": "Marc Frost <marc@cosmicdriftgamestudio.com>",
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
}
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@cosmicdrift/kumiko-framework": "0.156.
|
|
19
|
-
"@cosmicdrift/kumiko-headless": "0.156.
|
|
18
|
+
"@cosmicdrift/kumiko-framework": "0.156.3",
|
|
19
|
+
"@cosmicdrift/kumiko-headless": "0.156.3",
|
|
20
20
|
"react": "^19.2.6",
|
|
21
21
|
"temporal-polyfill": "^0.3.2"
|
|
22
22
|
},
|
package/src/format-when.ts
CHANGED
|
@@ -6,6 +6,16 @@ export function formatWhen(value: string): string {
|
|
|
6
6
|
try {
|
|
7
7
|
return Temporal.Instant.from(value).toLocaleString();
|
|
8
8
|
} catch {
|
|
9
|
-
|
|
9
|
+
// Temporal.Instant.from requires a UTC designator/offset — offset-less
|
|
10
|
+
// timestamps (still valid `new Date` input) throw here. Retry as a
|
|
11
|
+
// local wall-clock time before giving up and returning the raw string.
|
|
12
|
+
try {
|
|
13
|
+
return Temporal.PlainDateTime.from(value)
|
|
14
|
+
.toZonedDateTime(Temporal.Now.timeZoneId())
|
|
15
|
+
.toInstant()
|
|
16
|
+
.toLocaleString();
|
|
17
|
+
} catch {
|
|
18
|
+
return value;
|
|
19
|
+
}
|
|
10
20
|
}
|
|
11
21
|
}
|