@@ -25,11 +25,13 @@ class DatePickerExample extends React.Component<$FlowFixMeProps, $FlowFixMeState
2525 static defaultProps = {
2626 date : new Date ( ) ,
2727 timeZoneOffsetInHours : ( - 1 ) * ( new Date ( ) ) . getTimezoneOffset ( ) / 60 ,
28+ locale : false ,
2829 } ;
2930
3031 state = {
3132 date : this . props . date ,
3233 timeZoneOffsetInHours : this . props . timeZoneOffsetInHours ,
34+ locale : this . props . locale ,
3335 } ;
3436
3537 onDateChange = ( date ) => {
@@ -44,6 +46,10 @@ class DatePickerExample extends React.Component<$FlowFixMeProps, $FlowFixMeState
4446 this . setState ( { timeZoneOffsetInHours : offset } ) ;
4547 } ;
4648
49+ onLocaleChange = ( event ) => {
50+ this . setState ( { locale : event . nativeEvent . text } ) ;
51+ } ;
52+
4753 render ( ) {
4854 // Ideally, the timezone input would be a picker rather than a
4955 // text input, but we don't have any pickers yet :(
@@ -64,25 +70,35 @@ class DatePickerExample extends React.Component<$FlowFixMeProps, $FlowFixMeState
6470 />
6571 < Text > hours from UTC</ Text >
6672 </ WithLabel >
73+ < WithLabel label = "Locale:" >
74+ < TextInput
75+ onChange = { this . onLocaleChange }
76+ style = { styles . textinput }
77+ value = { this . state . locale }
78+ />
79+ </ WithLabel >
6780 < Heading label = "Date + time picker" />
6881 < DatePickerIOS
6982 date = { this . state . date }
7083 mode = "datetime"
7184 timeZoneOffsetInMinutes = { this . state . timeZoneOffsetInHours * 60 }
7285 onDateChange = { this . onDateChange }
86+ locale = { this . state . locale }
7387 />
7488 < Heading label = "Date picker" />
7589 < DatePickerIOS
7690 date = { this . state . date }
7791 mode = "date"
7892 timeZoneOffsetInMinutes = { this . state . timeZoneOffsetInHours * 60 }
7993 onDateChange = { this . onDateChange }
94+ locale = { this . state . locale }
8095 />
8196 < Heading label = "Time picker, 10-minute interval" />
8297 < DatePickerIOS
8398 date = { this . state . date }
8499 mode = "time"
85100 timeZoneOffsetInMinutes = { this . state . timeZoneOffsetInHours * 60 }
101+ locale = { this . state . locale }
86102 onDateChange = { this . onDateChange }
87103 minuteInterval = { 10 }
88104 />
0 commit comments