@astroapps/forms-core 2.0.1 → 2.1.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astroapps/forms-core",
3
- "version": "2.0.1",
3
+ "version": "2.1.0",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "lib/index.cjs",
@@ -28,7 +28,8 @@
28
28
  "dependencies": {
29
29
  "clsx": "^1 || ^2",
30
30
  "uuid": "^10.0.0",
31
- "jsonata": "^2.0.4"
31
+ "jsonata": "^2.0.4",
32
+ "@internationalized/date": "^3.10.0"
32
33
  },
33
34
  "peerDependencies": {
34
35
  "@astroapps/controls": "^1.4.0"
@@ -231,6 +231,7 @@ export interface DisplayOnlyRenderOptions extends RenderOptions {
231
231
  type: DataRenderType.DisplayOnly;
232
232
  emptyText?: string | null;
233
233
  sampleText?: string | null;
234
+ noSelection?: boolean | null;
234
235
  }
235
236
  export interface IconMapping {
236
237
  value: string;
@@ -9,11 +9,18 @@ import { SchemaInterface } from "./schemaInterface";
9
9
  import { SchemaDataNode } from "./schemaDataNode";
10
10
  import { SchemaNode } from "./schemaNode";
11
11
  import { Control, ControlSetup } from "@astroapps/controls";
12
+ import { parseDateTime as pdt } from "@internationalized/date";
12
13
 
13
14
  export class DefaultSchemaInterface implements SchemaInterface {
14
15
  constructor(
15
16
  protected boolStrings: [string, string] = ["No", "Yes"],
16
- protected parseDateTime: (s: string) => number = (s) => Date.parse(s),
17
+ protected parseDateTime: (s: string) => number = (s) => {
18
+ try {
19
+ return pdt(s).toDate("UTC").getTime();
20
+ } catch (e) {
21
+ return Number.NaN;
22
+ }
23
+ },
17
24
  ) {}
18
25
 
19
26
  parseToMillis(field: SchemaField, v: string): number {