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.34k stars 956 forks source link

Calendar/Datepicker: min value pager problem #680

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 minimum date value (native date), on a RangeDatepicker, the pager starts acting weird, you can't page the months.

rangeDatepicker_minStartDate

Expected behavior: Pager should work like it does when no minimum date value is set.

rangeDatepicker_withoutMinStartDate

Steps to reproduce:

  1. Add a rangedatepicker component.
  2. Set the range and assign the onSelect function (like the documents).
  3. Set a minimum date value. For example: minimum should be today. (The current default minimum value is: this.dateService.getYearStart(this.dateService.today());).
  4. Use the arrows on the top right to navigate between the months. As soon as you click the right one, the days disappear.

Related code:

const minStartDate = new Date();
minStartDate.setHours(0, 0, 0, 0);

<RangeDatepicker
  min={minStartDate}
  range={range}
  onSelect={this.onSelect}
/>

Feature request

Add the ability to change the first day of the week, currently it's always Sunday, but it would be nice to have Monday as the first day of the week.

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

Hi 👋 Thanks for reporting this. Investigating

artyorsh commented 5 years ago

@kevinbuyck I guess the fix will be available soon as we plan to release beta

artyorsh commented 5 years ago

@kevinbuyck glad to say the fix for navigation between months and start day of week feature are available. Try updating to beta

npm i react-native-ui-kitten@beta @eva-design/eva@beta
kevinbuyck commented 5 years ago

@artyorsh I will check it out later today or tomorrow. Nice!