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

Not showing past dates including current date on some iOS devices.

Open asiriPiyajanaka opened this issue 6 years ago • 5 comments

Issue

react-native-datepicker not showing in current date and past dates from current day on some iOS devices. Totally working on android and also working on some iOS devices.

IMG-20200604-WA0003

Expected Behavior

To work on all iOS devices. Like this - Screenshot 2020-06-08 at 4 23 51 PM

Code



import DatePicker from 'react-native-datepicker';

<DatePicker
 style={{ width: '108%', right: responsiveWidth(3) }}
 date={birthDate}
 mode="date"
 placeholder={this.state.birthDate == '' ? '': this.state.birthDate }
 format="YYYY-MM-DD"
 minDate={minDateStr}
 maxDate={new Date(Date.now() - 86400000)}
 confirmBtnText="Confirm"
 cancelBtnText="Cancel"
 showIcon={false}
 disabled={!this.state.isPageEditable}
 customStyles={{
	dateIcon: {
		position: 'absolute',
		left: 0,
		top: 4,
		marginLeft: 0,
		display: 'none'
	},
	dateInput: {
		// marginLeft: 36,
		backgroundColor: 'rgba(255, 255, 255, 0.15)',
		borderRadius: 10,
		height: responsiveHeight(6.5)

	},
	dateText: {
		color: 'white', textAlign: 'left', fontWeight: 'bold'
	},
	placeholderText: {
		color: 'white', alignContent: 'left', fontWeight: 'bold'
	}
	// ... You can check the source to find the other keys.
 }}
 onDateChange={(date) => { this.setState({ birthDate: date }) }}
							/>

Environment

  1. react-native -v: 0.60.5
  2. node -v: v12.14.1
  3. npm -v: 6.13.4
  4. yarn --version:
  5. target platform: Android | iOS
  6. operating system: macOS

asiriPiyajanaka avatar Jun 08 '20 11:06 asiriPiyajanaka

@asiriPiyajanaka Were you able to find the cause in the end?

hizbullah106 avatar Jun 19 '20 07:06 hizbullah106

Please check #365 may be that is your issue

khan8698 avatar Jun 19 '20 07:06 khan8698

@hizbullah106 @asiriPiyajanaka This occurs in iOS devices in which dark mode is enable.

https://github.com/xgfe/react-native-datepicker/issues/365#issuecomment-532875809

or

use custom styles like below customStyles={{ datePicker: { color: 'black', ios_backgroundColor: 'white', backgroundColor: 'white', }, datePickerCon: { color: 'black', ios_backgroundColor: 'white', backgroundColor: 'white', }, }}

sai-kiran-mh avatar Jul 21 '20 09:07 sai-kiran-mh

@hizbullah106 @asiriPiyajanaka This occurs in iOS devices in which dark mode is enable.

#365 (comment)

or

use custom styles like below customStyles={{ datePicker: { color: 'black', ios_backgroundColor: 'white', backgroundColor: 'white', }, datePickerCon: { color: 'black', ios_backgroundColor: 'white', backgroundColor: 'white', }, }}

hi is "ios_backgroundColor" a valid style?

carlmagumpara avatar Jul 27 '20 05:07 carlmagumpara