Skip to content

Commit

Permalink
fix(DatePicker): allow programmatic clearing values
Browse files Browse the repository at this point in the history
  • Loading branch information
N00nDay committed Nov 3, 2023
1 parent e92aea6 commit 40a826a
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/lib/components/datepicker/DateInput.svelte
Expand Up @@ -43,13 +43,13 @@
let valueDayJS: Dayjs | null;
let text: string | undefined;
// $: {
// valueDayJS = value === null ? null : dayjs(value);
// text = valueDayJS?.format(format);
// if (input && input.value) {
// input.value = text || '';
// }
// }
$: {
valueDayJS = value === null ? null : dayjs(value);
text = valueDayJS?.format(format);
if (input && input.value) {
input.value = text || '';
}
}
let currentError: Writable<string | undefined> = writable(error);
$: currentError.set(error);
Expand Down

0 comments on commit 40a826a

Please sign in to comment.