xgfe / react-native-datepicker

react native datePicker component for both Android and IOS, useing DatePikcerAndroid, TimePickerAndroid and DatePickerIOS
MIT License
2.12k stars 725 forks source link

TimePickerAndroid has been removed from React Native #414

Open ikedm opened 4 years ago

ikedm commented 4 years ago

Issue

The date picker will not show up anymore. In debug mode it gives the error:

DatePickerAndroid has been merged with DatePickerIOS and will be removed in a future release. It can now be installed and imported from '@react-native-community/datetimepicker' instead of 'react-native'

Expected Behavior

The date picker shows up

Code

Environment

  1. react-native -v: 0.62.0
  2. node -v: 12.8.0
  3. npm -v: 6.10.3
  4. yarn --version: 1.17.0-20190429.1820
  5. target platform: Android
  6. operating system: Mac
bunsha commented 4 years ago

nobody is mainainig this repo, as i can c, so - just use @react-native-community/datetimepicker instead.

hapablap21 commented 4 years ago

That's sad, this package had features that I liked and that the community one doesn't. :(

Rejsal commented 4 years ago

I have forked and updated to use @react-native-community/datetimepicker for modes: date and time. Not updated for mode datetime. Let me know if it is not working. https://github.com/Rejsal/react-native-datepicker

bunsha commented 4 years ago

That's kinda cool

ср, 10 июн. 2020 г., 14:36 Rejsal notifications@github.com:

I have forked and updated to use @react-native-community/datetimepicker https://github.com/Rejsal/react-native-datepicker

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/xgfe/react-native-datepicker/issues/414#issuecomment-641943673, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABY6V6XSYR7JSZ3DPAJGNODRV5V2NANCNFSM4MNNUUEQ .

svenlombaert commented 4 years ago

I wanted to install it @Rejsal but you made a small mistake in your package.json file. Line 29 has a trailing comma which is not allowed in json. https://github.com/Rejsal/react-native-datepicker/blob/master/package.json#L29

nathan-haines commented 4 years ago

@Rejsal I would also love to download it, but am running into the same issue as sven. Any update?

Rejsal commented 4 years ago

Removed trailing comma from package.json

nathan-haines commented 4 years ago

Hey @Rejsal , Im running into an issue trying to use your fork. When I try clicking the DatePicker on android I get the following error:

image

I am using the DatePicker like so:

<DatePicker
                style={styles.timePicker}
                date={this.state.time || '12:00'}
                format={'hh:mm a'}
                mode="time"
                placeholder={formatMessage(messages.date)}
                confirmBtnText="Confirm"
                cancelBtnText="Cancel"
                showIcon={false}
                onDateChange={(time) => this.formChanged('time', time)}
              />

Any thoughts?

Rejsal commented 4 years ago

I think I didn’t remove DatePickerAndroid due to datetime mode there. So maybe DatePickerAndroid.open() undefined error is thrown there if it is already removed by react native. May be you can fork and remove the “if(mode == ‘datetime’)” Condition and it’s inner functions which uses DatePickerAndroid from datepicker.js. Sorry I have only updated the code for modes ‘date’ and ‘time’ and didn’t remove the datetime mode.

Rejsal commented 4 years ago

Removed datetime mode from my fork.

dionisio28 commented 4 years ago

Hey @Rejsal , Im running into an issue trying to use your fork. When I try clicking the DatePicker on android I get the following error:

image

I am using the DatePicker like so:

<DatePicker
                style={styles.timePicker}
                date={this.state.time || '12:00'}
                format={'hh:mm a'}
                mode="time"
                placeholder={formatMessage(messages.date)}
                confirmBtnText="Confirm"
                cancelBtnText="Cancel"
                showIcon={false}
                onDateChange={(time) => this.formChanged('time', time)}
              />

Any thoughts?

hello @nathan-haines , I'm having the same problem, can you solve it?

Luckygirlllll commented 4 years ago

@Rejsal I just have installed your fork and it works on Android, however, androidMode="spinner" doesn't work, I see just a usual clock instead, how can I make it work?

Luckygirlllll commented 4 years ago

@Rejsal I added my own fork which supports androidMode, if anyone needs it, here it is: https://github.com/Luckygirlllll/react-native-datepicker

princealirehman1 commented 4 years ago

mode='time' still not working on Android. TimePickerAndroid has been removed from React Native. Any one has a workaround for this ?

princealirehman1 commented 4 years ago

@Rejsal I tried your fork, Its not crashing the app but the mode='time' is not opening the time picker on Android.

mehrankhandev commented 3 years ago

if you still using this library like me and need "datetime" support i have forked the library . please try this https://github.com/mehrankhandev/react-native-datepicker

Note: you have to install @react-native-community/datetimepicker first

afanchamp commented 3 years ago

Hello, i am using react-native-modal-datetime-picker https://www.npmjs.com/package/react-native-modal-datetime-picker i updated React Native version to 0.63 and now on android the date picker shows up but time picker doesn't. I tried to use @react-native-community/datetimepicker but getting same error. anyone who could help me solve this ? Screenshot_2020-12-11-00-59-31-466_com squadly

maddeha commented 3 years ago

@Rejsal I added my own fork which supports androidMode, if anyone needs it, here it is: https://github.com/Luckygirlllll/react-native-datepicker

You saved my day

salmanullahkhan15 commented 3 years ago

None of the fork mentioned about is working for me. Can anyone help me?

ZakaR00 commented 2 years ago

mode = time still doesn't work. Who has solved this problem?

satyabrata45 commented 2 years ago

if you still using this library like me and need "datetime" support i have forked the library . please try this https://github.com/mehrankhandev/react-native-datepicker

Note: you have to install @react-native-community/datetimepicker first

Not Working on IOS