react-native-datepicker icon indicating copy to clipboard operation
react-native-datepicker copied to clipboard

TimePickerAndroid has been removed from React Native

Open ikedm opened this issue 5 years ago • 21 comments
trafficstars

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

ikedm avatar Apr 21 '20 16:04 ikedm

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

bunsha avatar Apr 23 '20 03:04 bunsha

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

hapablap21 avatar May 07 '20 18:05 hapablap21

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

Rejsal avatar Jun 10 '20 11:06 Rejsal

That's kinda cool

ср, 10 июн. 2020 г., 14:36 Rejsal [email protected]:

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 .

bunsha avatar Jun 10 '20 11:06 bunsha

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

svenlombaert avatar Jun 22 '20 14:06 svenlombaert

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

nathan-haines avatar Jun 30 '20 17:06 nathan-haines

Removed trailing comma from package.json

Rejsal avatar Jun 30 '20 18:06 Rejsal

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?

nathan-haines avatar Jul 02 '20 16:07 nathan-haines

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 avatar Jul 02 '20 18:07 Rejsal

Removed datetime mode from my fork.

Rejsal avatar Jul 03 '20 16:07 Rejsal

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?

dionisio28 avatar Aug 06 '20 13:08 dionisio28

@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 avatar Sep 09 '20 08:09 Luckygirlllll

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

Luckygirlllll avatar Sep 09 '20 09:09 Luckygirlllll

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

princealirehman1 avatar Oct 05 '20 06:10 princealirehman1

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

princealirehman1 avatar Oct 05 '20 06:10 princealirehman1

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

mehrankhandev avatar Nov 05 '20 09:11 mehrankhandev

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

afanchamp avatar Dec 10 '20 20:12 afanchamp

@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

maddeha avatar Apr 30 '21 20:04 maddeha

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

salmanullahkhan15 avatar May 18 '21 10:05 salmanullahkhan15

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

ZakaR00 avatar Dec 04 '21 11:12 ZakaR00

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

satyabrata45 avatar Mar 08 '22 05:03 satyabrata45