Skip to content

Is it possible to create a calendar that can select multiple dates with useCalendar? #3657

Answered by reidbarber
danthareja asked this question in Q&A
Discussion options

You must be logged in to vote

Not with the current hooks. You would basically need a version of useCalendarState and useCalendar that supports multiple selected values. So in place of CalendarState, make something like MultiCalendarState:

export interface CalendarState extends CalendarStateBase {
/** The currently selected date. */
readonly value: CalendarDate,
/** Sets the currently selected date. */
setValue(value: CalendarDate): void
}

export interface MultiCalendarState extends CalendarStateBase {
  /** The currently selected dates. */
  readonly values: Set<CalendarDate>,
  /** Sets t…

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@danthareja
Comment options

@brielov
Comment options

@jpbesgen
Comment options

@danthareja
Comment options

@timurmaio
Comment options

Answer selected by danthareja
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants