akveo / react-native-ui-kitten

:boom: React Native UI Library based on Eva Design System :new_moon_with_face::sparkles:Dark Mode
https://akveo.github.io/react-native-ui-kitten/
MIT License
10.33k stars 954 forks source link

Calendar: month selection disabled based on filter #687

Closed kevinbuyck closed 5 years ago

kevinbuyck commented 5 years ago

Issue type

I'm submitting a ... (check one with "x")

Issue description

Current behavior: As soon as I set a filter (for example: no Saturdays or Sunday's) on a RangeCalendar, the months in the month selection also get disabled based on this filter (for example: the months where the first day of the month is Saturday or Sunday, will be disabled).

Schermafbeelding 2019-10-17 om 16 33 47

Expected behavior: Month selection should be disabled based on min and max only.

Steps to reproduce:

  1. Add a rangecalendar component.
  2. Set the range and assign the onSelect function (like the documents).
  3. Set a filter.
  4. Use the arrow on the top left to select a month.

Related code:

private onRangeFilter = (date: Date) => {
  return date.getDay() !== 0 && date.getDay() !== 6;
};

<RangeCalendar
  filter={this.onRangeFilter}
  range={range}
  onSelect={this.onRangeSelect}
/>

Other information:

OS, device, package version

React Native v0.61.1 on iPhone 11 Pro simulator 11.1.
React Native UI Kitten v4.2.0.
artyorsh commented 5 years ago

Thanks for reporting this :)