Skip to content

useCalendarState how to display x days starting from a date #3477

Answered by devongovett
snax4a asked this question in Q&A
Discussion options

You must be logged in to vote

Yes, getDatesInWeek always returns a week's worth of dates. It's meant to be a helper for month or week based calendars. You'll need to generate the dates yourself based on the visibleRange. Something like this:

let dates = [];
let date = state.visibleRange.start;
while (date.compare(state.visibleRange.end) <= 0) {
  dates.push(date);
  date = date.add({days: 1});
}

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by snax4a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants