@ultimat3/admin 31.4.2 → 31.6.0
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 +17 -17
- package/src/form-decode.ts +12 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ultimat3/admin",
|
|
3
|
-
"version": "31.
|
|
3
|
+
"version": "31.6.0",
|
|
4
4
|
"description": "Two dashboards: the /_x framework dev panels and the generated, AI-first app admin",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ultimate",
|
|
@@ -46,21 +46,21 @@
|
|
|
46
46
|
"test": "bun test"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@ultimat3/action": "31.
|
|
50
|
-
"@ultimat3/ai": "31.
|
|
51
|
-
"@ultimat3/cache": "31.
|
|
52
|
-
"@ultimat3/core": "31.
|
|
53
|
-
"@ultimat3/db": "31.
|
|
54
|
-
"@ultimat3/entity": "31.
|
|
55
|
-
"@ultimat3/http": "31.
|
|
56
|
-
"@ultimat3/i18n": "31.
|
|
57
|
-
"@ultimat3/jobs": "31.
|
|
58
|
-
"@ultimat3/mcp": "31.
|
|
59
|
-
"@ultimat3/money": "31.
|
|
60
|
-
"@ultimat3/policy": "31.
|
|
61
|
-
"@ultimat3/query": "31.
|
|
62
|
-
"@ultimat3/render": "31.
|
|
63
|
-
"@ultimat3/schema": "31.
|
|
64
|
-
"@ultimat3/ui": "31.
|
|
49
|
+
"@ultimat3/action": "31.6.0",
|
|
50
|
+
"@ultimat3/ai": "31.6.0",
|
|
51
|
+
"@ultimat3/cache": "31.6.0",
|
|
52
|
+
"@ultimat3/core": "31.6.0",
|
|
53
|
+
"@ultimat3/db": "31.6.0",
|
|
54
|
+
"@ultimat3/entity": "31.6.0",
|
|
55
|
+
"@ultimat3/http": "31.6.0",
|
|
56
|
+
"@ultimat3/i18n": "31.6.0",
|
|
57
|
+
"@ultimat3/jobs": "31.6.0",
|
|
58
|
+
"@ultimat3/mcp": "31.6.0",
|
|
59
|
+
"@ultimat3/money": "31.6.0",
|
|
60
|
+
"@ultimat3/policy": "31.6.0",
|
|
61
|
+
"@ultimat3/query": "31.6.0",
|
|
62
|
+
"@ultimat3/render": "31.6.0",
|
|
63
|
+
"@ultimat3/schema": "31.6.0",
|
|
64
|
+
"@ultimat3/ui": "31.6.0"
|
|
65
65
|
}
|
|
66
66
|
}
|
package/src/form-decode.ts
CHANGED
|
@@ -92,6 +92,17 @@ const jsonOf = (raw: string): unknown => {
|
|
|
92
92
|
}
|
|
93
93
|
};
|
|
94
94
|
|
|
95
|
+
/**
|
|
96
|
+
* `datetime-local` text → the UTC instant the control says it is, or the text as typed. Both an
|
|
97
|
+
* Invalid Date and a rolled-over one (`02-30` read as `03-02`) fail the round trip back to the
|
|
98
|
+
* minutes that were posted, so neither reaches the schema in place of what the operator wrote.
|
|
99
|
+
*/
|
|
100
|
+
const instantOf = (raw: string): unknown => {
|
|
101
|
+
const minutes = raw.slice(0, 16);
|
|
102
|
+
const at = new Date(`${minutes}:00.000Z`);
|
|
103
|
+
return isoOf(at) === `${minutes}:00.000Z` ? at : raw;
|
|
104
|
+
};
|
|
105
|
+
|
|
95
106
|
function decodeField(field: AdminField, form: Posted): unknown {
|
|
96
107
|
const raw = posted(form, field.name);
|
|
97
108
|
// An unchecked box posts nothing at all, so absence IS the answer for a checkbox.
|
|
@@ -111,7 +122,7 @@ function decodeField(field: AdminField, form: Posted): unknown {
|
|
|
111
122
|
case 'datetime':
|
|
112
123
|
// `datetime-local` posts `YYYY-MM-DDTHH:mm` and the control says UTC beside the box; a
|
|
113
124
|
// calendar date stays the `YYYY-MM-DD` string its column holds.
|
|
114
|
-
return field.type === 'date' ? raw :
|
|
125
|
+
return field.type === 'date' ? raw : instantOf(raw);
|
|
115
126
|
case 'json-editor':
|
|
116
127
|
return jsonOf(raw);
|
|
117
128
|
default:
|