question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

System: OS: Windows 10 CPU: (4) x64 Intel® Core™ 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!

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
mmazzarolocommented, 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 👍

0reactions
fgagnetencommented, Sep 25, 2019

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Datepicker dialog without calendar visualization in lollipop ...
It's 2019 now and this issue still persists. android:datePickerMode="spinner" doesn't work at all the APIs; Integrating a library for such a simple task...
Read more >
DatePicker - Android Developers
The set of spinners and the calendar view are automatically synchronized. ... This method was deprecated in API level 24. Not ... android:datePickerMode....
Read more >
Use DatePicker spinners in API 24 - gists · GitHub
Workaround for this bug: https://code.google.com/p/android/issues/detail?id=222208. * In Android 7.0 Nougat, spinner mode for the DatePicker in ...
Read more >
Characterizing and Detecting Configuration Compatibility ...
In our empirical study, we observe that among the 196 real- world configuration compatibility issues in 43 popular Android apps, 89 (45.4%) of ......
Read more >
datepicker android kotlin | The Search Engine You Control
In android DatePicker having two modes, first one to show the complete calendar and second one shows the dates in spinner... <?xml version="1.0"encoding= ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found