|
5 | 5 | # [Demo](https://dmtrkovalenko.github.io/material-ui-datetimepicker/)
|
6 | 6 | Component, that joins Material UI`s pickers into the one component, one input and 2 dialogs, appearing one by one.
|
7 | 7 |
|
8 |
| -### Breaking change |
9 |
| -Due to support of React 16 it was required to change the logic of this component work. Because of each ref should have an owner and material-ui components have refs inside their implementation you should pass created component from material-ui to this datetimepicker via props |
10 |
| - |
11 |
| -*do* |
12 |
| -```jsx |
13 |
| -import DatePickerDialog from 'material-ui/DatePicker/DatePickerDialog'; |
14 |
| -import TimePickerDialog from 'material-ui/TimePicker/TimePickerDialog'; |
15 |
| - |
16 |
| -<DateTimePicker |
17 |
| - onChange={this.setDate} |
18 |
| - DatePicker={DatePickerDialog} |
19 |
| - TimePicker={TimePickerDialog} |
20 |
| -/> |
21 |
| -``` |
22 |
| - |
23 | 8 | We are recommending to use your custom wrapper outside of this component to store your custom props, and not pass Dialogs each time you use this package, because it should be solved in one of next material-ui versions
|
24 | 9 |
|
25 | 10 | ### Dependencies
|
@@ -69,12 +54,12 @@ import DatePickerDialog from 'material-ui/DatePicker/DatePickerDialog';
|
69 | 54 | import TimePickerDialog from 'material-ui/TimePicker/TimePickerDialog';
|
70 | 55 |
|
71 | 56 | <DateTimePicker
|
| 57 | + value={new Date()} // picker value moment/string/number/js Date |
72 | 58 | format='MMM DD, YYYY hh:mm A'
|
73 | 59 | timePickerDelay={150}
|
74 | 60 | returnMomentDate={false} // if true will return moment object
|
75 | 61 | className='datetime-container'
|
76 | 62 | textFieldClassName='datetime-input'
|
77 |
| - defaultTime={null} // will accept Date or moment |
78 | 63 | name='picker' // form value name
|
79 | 64 | datePickerMode='portrait' // or landscape
|
80 | 65 | openToYearSelection={false}
|
|
0 commit comments