We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0437105 commit de1f6a8Copy full SHA for de1f6a8
packages/shoelace/src/widgets/date.ts
@@ -16,8 +16,12 @@ export const date: Widgets['date'] = (options) => html`
16
.id=${options.id}
17
.required=${options.required ?? false}
18
@sl-input=${(event: CustomEvent) => {
19
- const { valueAsDate: newValue } = event.target as SlInput;
20
- options.valueChangedCallback?.(newValue ?? undefined);
+ const { valueAsDate: newValue, value } = event.target as SlInput;
+
21
+ options.valueChangedCallback?.(
22
+ // NOTE: Date time does not return `valueAsDate`
23
+ newValue ?? value ? new Date(value) : undefined,
24
+ );
25
}}
26
>
27
</sl-input>
0 commit comments