@@ -13,7 +13,9 @@ import {
13
13
Alert ,
14
14
FlatList ,
15
15
} from 'react-native' ;
16
- import DateTimePicker from '@react-native-community/datetimepicker' ;
16
+ import DateTimePicker , {
17
+ MaterialRangePicker ,
18
+ } from '@react-native-community/datetimepicker' ;
17
19
import SegmentedControl from './SegmentedControl' ;
18
20
import { Colors } from 'react-native/Libraries/NewAppScreen' ;
19
21
import React , { useRef , useState } from 'react' ;
@@ -216,6 +218,22 @@ export const App = () => {
216
218
setMaximumDate ( minimumDate ? undefined : endOfTomorrowUTC ) ;
217
219
} ;
218
220
221
+ const handleShowRangePicker = ( ) => {
222
+ MaterialRangePicker . open ( {
223
+ fullscreen : isFullscreen ,
224
+ initialInputMode : inputMode ,
225
+ maximumDate,
226
+ minimumDate,
227
+ title,
228
+ timeZoneOffsetInMinutes : tzOffsetInMinutes ,
229
+ timeZoneName : tzName ,
230
+ dialogButtons : {
231
+ negative : { label : 'Nope' } ,
232
+ positive : { label : 'Yes' } ,
233
+ } ,
234
+ } ) ;
235
+ } ;
236
+
219
237
if ( Platform . OS !== 'windows' ) {
220
238
return (
221
239
< SafeAreaView
@@ -435,6 +453,14 @@ export const App = () => {
435
453
title = "Show and dismiss picker!"
436
454
/>
437
455
</ View >
456
+ < View style = { styles . header } >
457
+ < ThemedText style = { styles . textLabel } >
458
+ [android] show range picker
459
+ </ ThemedText >
460
+ </ View >
461
+ < View style = { styles . button } >
462
+ < Button onPress = { handleShowRangePicker } title = "Show range picker" />
463
+ </ View >
438
464
< View
439
465
style = { [
440
466
styles . button ,
0 commit comments