@@ -57,7 +57,7 @@ npm install react-native-paper-dates --save
5757
5858## Usage
5959
60- ### Single date Picker
60+ ### Single date Picker (modal)
6161
6262``` tsx
6363import * as React from ' react' ;
@@ -107,7 +107,7 @@ export default function ReadMeExampleSingle() {
107107}
108108```
109109
110- ### Range picker
110+ ### Range picker (modal)
111111``` tsx
112112import * as React from ' react' ;
113113import { Button } from ' react-native-paper' ;
@@ -140,7 +140,7 @@ export default function ReadMeExampleRange() {
140140 Pick range
141141 </Button >
142142 <DatePickerModal
143- // locale={'en'} optional, default: automatic
143+ locale = " en "
144144 mode = " range"
145145 visible = { open }
146146 onDismiss = { onDismiss }
@@ -153,7 +153,6 @@ export default function ReadMeExampleRange() {
153153 // disabledDates: [new Date()] // optional
154154 // }}
155155 // onChange={} // same props as onConfirm but triggered without confirmed by user
156- // locale={'nl'} // optional
157156 // saveLabel="Save" // optional
158157 // label="Select period" // optional
159158 // startLabel="From" // optional
@@ -195,7 +194,7 @@ export default function ReadMeExampleMultiple() {
195194 </Button >
196195
197196 <DatePickerModal
198- // locale={'en'} optional, default: automatic
197+ locale = " en "
199198 mode = " multiple"
200199 visible = { open }
201200 onDismiss = { onDismiss }
@@ -207,7 +206,6 @@ export default function ReadMeExampleMultiple() {
207206 // endDate: new Date(), // optional
208207 // disabledDates: [new Date()] // optional
209208 // }}
210- // locale={'nl'} // optional
211209 // saveLabel="Save" // optional
212210 // label="Select period" // optional
213211 // startLabel="From" // optional
@@ -219,6 +217,28 @@ export default function ReadMeExampleMultiple() {
219217}
220218```
221219
220+ ### Input date with modal button
221+ ``` tsx
222+ export default function ReadMeExampleDatePickerInput() {
223+ const [inputDate, setInputDate] = React .useState <Date | undefined >(undefined )
224+
225+ return (
226+ <>
227+ <DatePickerInput
228+ locale = " en"
229+ label = " Birthdate"
230+ value = { inputDate }
231+ onChange = { (d ) => setInputDate (d )}
232+ inputMode = " start"
233+ // mode="outlined" (see react-native-paper docs)
234+ // other react native TextInput props
235+ />
236+ </>
237+ )
238+ }
239+
240+ ```
241+
222242### Time picker
223243``` tsx
224244import * as React from ' react'
@@ -252,7 +272,7 @@ export default function TimePickerPage() {
252272 cancelLabel = " Cancel" // optional, default: 'Cancel'
253273 confirmLabel = " Ok" // optional, default: 'Ok'
254274 animationType = " fade" // optional, default is 'none'
255- locale = { ' en ' } // optional, default is automically detected by your system
275+ locale = " en " // optional, default is automically detected by your system
256276 />
257277 <Button onPress = { ()=> setVisible (true )} >
258278 Pick time
0 commit comments