node: v9.8.0
react: 16.3.2
native-base: 2.6.1
Showing default date if placeHolderText prop isn't specified
Picker shows "Select Date" string
checked only in Android, can't test in ios
Added with 2.7.1
If anybody is still facing problem, then one use this hack:
Assign default date to placeholder text
placeHolderText={this.formatDate(your_default_date)}
export const formatDate = date => {
return `${date.getMonth() + 1}/${date.getDate()}/${date.getFullYear()}`;
};
Do this, I'm using native base 2.12.1.
<DatePicker
defaultDate={value}
placeHolderText={!value ? placeholder : null}
...
/>
Most helpful comment
If anybody is still facing problem, then one use this hack:
Assign default date to placeholder text
placeHolderText={this.formatDate(your_default_date)}