henninghall / react-native-date-picker

React Native Date Picker is datetime picker for Android and iOS. It includes date, time and datetime picker modes. The datepicker is customizable and is supporting different languages. It's written with native code to achieve the best possible look, feel and performance.
MIT License
2.21k stars 338 forks source link

Incorrect year returned when setting a maximum date on Android #859

Open rvera opened 2 weeks ago

rvera commented 2 weeks ago

Describe the bug When setting a maximum date 10 years in the future, and selecting a new date on the picker, it will return a date with the year of the maximum date.

Expected behavior Return a year of the year selected (current)

To Reproduce Add example code that reproduces the behavior.

<DatePicker
  date={new Date('2024-12-01T00:00:00')}
  onDateChange={async newDate => {
    console.log(newDate);
  }}
  mode="datetime"
  minuteInterval={60 * 30}
  maximumDate={new Date('2034-12-01T00:00:00')}
/>

Smartphone (please complete the following information):