Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

datePickerModeAndroid="calendar" not working at least in API 24 #287

Closed
fgagneten opened this issue Sep 24, 2019 · 5 comments
Closed

datePickerModeAndroid="calendar" not working at least in API 24 #287

fgagneten opened this issue Sep 24, 2019 · 5 comments
Labels

Comments

@fgagneten
Copy link

System:
OS: Windows 10
CPU: (4) x64 Intel(R) Core(TM) i7-5500U CPU @ 2.40GHz
Memory: 2.04 GB / 15.88 GB
Binaries:
Node: 8.11.1
Yarn: 1.12.3
npm: 6.1.0
SDKs:
Android SDK:
Android NDK: 16.1.4479499
IDEs:
Android Studio: Version 3.5.0.0 AI-191.8026.42.35.5791312

Platforms

Android

Versions

  • Android: Simulator 7.0 API 24
  • react-native-modal-datetime-picker: 7.5.0
  • react-native: 0.60.5
  • react: 16.8.6

Description

I want to use Calendar Style for the DatePicker. However, after setting
datePickerModeAndroid="calendar"
The style of the date picker is "spinner". In some device (API 8.0) works the "date" mode like a charm. I think that the component is getting the default value and not what I set. This is the component:

<DateTimePicker
    datePickerModeAndroid="calendar"
    mode="date"
    isVisible={this.state.isCalendarVisible}
    onConfirm={date => this.updateAgenda(date)}
    minimumDate={minDate}
    date={selectedDate}
    maximumDate={maxDate}
    onCancel={() => this.hideAgenda()}
  />

image

I would like to know how to change the mode to "date" so I can see the picker like this:

image

Thanks!

@fgagneten fgagneten added the bug label Sep 24, 2019
@mmazzarolo
Copy link
Owner

@fgagneten 👋 thanks for submitting this issue!

Question: does the calendar setting work correctly with the standard DatePickerAndroid API?
I'm asking because from a quick check it looks like we're supplying the datePickerModeAndroid prop directly to the DatePickerAndroid's mode setting, so I don't why it should not be working 🤔

@fgagneten
Copy link
Author

There is a migration from DatePickerAndroid to DateTimePicker. Doe it has something related to the issue? I didn't give DatePickerAndroid a try to know if the issue is related with the library or React Native

https://github.com/react-native-community/react-native-datetimepicker#react-native-datetimepicker

@mmazzarolo
Copy link
Owner

I didn't give DatePickerAndroid a try to know if the issue is related with the library or React Native

Could you give it a try?

react-native-modal-datetime-picker is still using the react-native APIs under the hood.
A migration to the new community module is being worked on #262

@fgagneten
Copy link
Author

Yes, of course. I did it. It is not related to this library. However, it would great considering a workaround to solve this problem and make it transparent for us. Probably using some style or a custom class using native code.
Thanks

@mmazzarolo
Copy link
Owner

mmazzarolo commented Sep 25, 2019

Yes, of course. I did it. It is not related to this library.

@fgagneten gotcha, thanks for reporting.

However, it would great considering a workaround to solve this problem and make it transparent for us. Probably using some style or a custom class using native code.

I'm sorry but it's out of the scope of this library 😞
In react-native-modal-datetime-picker we won't mess around with native code.
The issue should be solved directly on the library that handles the picker (which can be react-native or the @react-native-community/react-native-datetimepicker).
If you know a solution for the issue at native level I would suggest you to start a discussion in these libraries. Otherwise, if you know a valid workaround, we can add it to the README.md 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants