A React Indigenous day picker part that enables you to choose a day in a week or month sight.
Exactly how to utilize it:
1. Set up and also import needed parts.
# NPM . $ npm i react-native-week-month-date-picker
import {addDays} from 'date-fns'; . import * as React from 'respond'; . import {SafeAreaView, StyleSheet, Text, Sight} from' react-native'; . import {DatePicker} from' react-native-week-month-date-picker';
2. Produce a day picker in your application.
export default feature Application() { . const minDate =brand-new Day(); . const[selectedDate, setSelectedDate]= React.useState ( brand-new Day()); . return( . < SafeAreaView design= {{> flex: <1}} > . < DatePicker . minDate ={ minDate} . maxDate= {addDays (minDate, 120)} . markedDates= {[minDate, addDays(new Date(), 2)]} . selectedDate ={ . selectedDate} . onDateChange= {(day )= > setSelectedDate( day)} . disabledDates= {[addDays(new Date(), 1), addDays(new Date(), 3)]} . allowsPastDates= { incorrect} . place= "en" translations = { { . todayButtonText: 'Today'; .} } < .