Skip to content

Commit

Permalink
chore: improve using of types
Browse files Browse the repository at this point in the history
  • Loading branch information
felipefialho committed Jan 29, 2025
1 parent 1e53d1f commit 2cb1ff5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/core/src/components/datetime/datetime.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
DatetimeHighlightCallback,
DatetimePresentation,
} from '@ionic/core'
import { JSX } from '@ionic/core/dist/types/components'
import {
Component,
Element,
Expand Down Expand Up @@ -140,8 +141,10 @@ export class AtomDatetime {
this.atomChange.emit(this.selectedDates)
}

private handleDateChange = (event) => {
const dates = event.detail.value || []
private handleDateChange: JSX.IonDatetime['onIonChange'] = (event) => {
const dates = Array.isArray(event.detail.value)
? event.detail.value
: [event.detail.value]

if (this.rangeMode) {
this.handleRangeMode(dates)
Expand Down

0 comments on commit 2cb1ff5

Please sign in to comment.