From 9cdc9c5886973f6fc3f41ca900f59c5b16e08d86 Mon Sep 17 00:00:00 2001 From: Davide Mininni Date: Mon, 27 Nov 2023 14:49:52 +0100 Subject: [PATCH] fix: lint --- src/components/datepicker/datepicker/datepicker.stories.ts | 4 ++-- src/components/time-input/time-input.stories.ts | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/datepicker/datepicker/datepicker.stories.ts b/src/components/datepicker/datepicker/datepicker.stories.ts index f5187b3930d..86aa35d53c6 100644 --- a/src/components/datepicker/datepicker/datepicker.stories.ts +++ b/src/components/datepicker/datepicker/datepicker.stories.ts @@ -312,9 +312,9 @@ const playStory = async ({ canvasElement }): Promise => { userEvent.click(toggle); }; -const changeEventHandler = async (event): Promise => { +const changeEventHandler = (event): void => { const div = document.createElement('div'); - div.innerText = `valueAsDate is: ${await event.target.getValueAsDate()}.`; + div.innerText = `valueAsDate is: ${event.target.valueAsDate}.`; document.getElementById('container-value')?.append(div); }; diff --git a/src/components/time-input/time-input.stories.ts b/src/components/time-input/time-input.stories.ts index 70d8e87f209..515513f147c 100644 --- a/src/components/time-input/time-input.stories.ts +++ b/src/components/time-input/time-input.stories.ts @@ -35,13 +35,13 @@ const updateFormError = (event: CustomEvent): void => { } }; -const changeEventHandler = async (event: CustomEvent): Promise => { +const changeEventHandler = (event: CustomEvent): void => { const target = event.target as SbbTimeInput; const exampleParent = target.closest('div#example-parent')!; const div = document.createElement('div'); div.innerText = `value is: ${ (exampleParent.querySelector('#input-id') as HTMLInputElement).value - }; valueAsDate is: ${await target.getValueAsDate()}.`; + }; valueAsDate is: ${target.valueAsDate}.`; exampleParent.querySelector('#container-value')!.append(div); }; @@ -50,7 +50,7 @@ const setValueAsDate = async (event: Event): Promise => { const exampleParent = target.closest('div#example-parent')!; const timeInput = exampleParent.querySelector('sbb-time-input')!; - await timeInput.setValueAsDate(new Date()); + timeInput.valueAsDate = new Date(); const input = exampleParent.querySelector('#input-id') as HTMLInputElement; input.dispatchEvent(new Event('change')); // Trigger change to update invalid state