Hi,
NativeBase : 2.6.1
I need to change the format of the date shown after picking a date. I couldn't find a prop just like format in DatePickerAndroid which allows me to change the date format I picked. Is this already implemented or yet to be implemented?
@Cassendra4 To what format you want to change?
I want both "MMM DD YYYY" and "ddd, MMM DD YYYY" formats
Related PR #2022
Added with with 2.7.1
It might be helpful to add this to the docs, so people don't have to dig for this in the future.
Hi, is there any example for formatChosenDate props ?
This is how I return a formatted date string with momentjs, which is in the users locale:
formatChosenDate={date => {return moment(date).format('L');}}
import format from 'date-fns/fp/format';
import { DatePicker as DP} from 'native-base';
const export DatePicker = props => (
<DP
formatChosenDate={format("MMM do, YYYY")}
...props
/>
);
How to use it to select only month or year
Most helpful comment
It might be helpful to add this to the docs, so people don't have to dig for this in the future.