@@ -2,8 +2,6 @@ import React from 'react';
22import DatePicker from 'material-ui/DatePicker' ;
33import Toggle from 'material-ui/Toggle' ;
44
5- const DateTimeFormat = global . Intl . DateTimeFormat ;
6-
75const optionsStyle = {
86 maxWidth : 255 ,
97 marginRight : 'auto' ,
@@ -29,13 +27,13 @@ export default class DatePickerExampleToggle extends React.Component {
2927 } ;
3028 }
3129
32- handleChangeMinDate = ( x , date ) => {
30+ handleChangeMinDate = ( event , date ) => {
3331 this . setState ( {
3432 minDate : date ,
3533 } ) ;
3634 } ;
3735
38- handleChangeMaxDate = ( x , date ) => {
36+ handleChangeMaxDate = ( event , date ) => {
3937 this . setState ( {
4038 maxDate : date ,
4139 } ) ;
@@ -51,55 +49,40 @@ export default class DatePickerExampleToggle extends React.Component {
5149 return (
5250 < div >
5351 < DatePicker
54- formatDate = { new DateTimeFormat ( 'en-US' , {
55- day : 'numeric' ,
56- month : 'short' ,
57- year : 'numeric' ,
58- weekday : 'short' ,
59- } ) . format }
6052 floatingLabelText = "Ranged Date Picker"
6153 autoOk = { this . state . autoOk }
6254 minDate = { this . state . minDate }
6355 maxDate = { this . state . maxDate }
56+ defaultDate = { new Date ( ) }
6457 disableYearSelection = { this . state . disableYearSelection }
6558 />
6659 < div style = { optionsStyle } >
6760 < DatePicker
68- formatDate = { new DateTimeFormat ( 'en-US' , {
69- day : 'numeric' ,
70- month : 'short' ,
71- year : 'numeric' ,
72- weekday : 'short' ,
73- } ) . format }
7461 onChange = { this . handleChangeMinDate }
7562 autoOk = { this . state . autoOk }
7663 floatingLabelText = "Min Date"
7764 defaultDate = { this . state . minDate }
65+ disableYearSelection = { this . state . disableYearSelection }
7866 />
7967 < DatePicker
80- formatDate = { new DateTimeFormat ( 'en-US' , {
81- day : 'numeric' ,
82- month : 'short' ,
83- year : 'numeric' ,
84- weekday : 'short' ,
85- } ) . format }
8668 onChange = { this . handleChangeMaxDate }
8769 autoOk = { this . state . autoOk }
8870 floatingLabelText = "Max Date"
8971 defaultDate = { this . state . maxDate }
72+ disableYearSelection = { this . state . disableYearSelection }
9073 />
9174 < Toggle
9275 name = "autoOk"
9376 value = "autoOk"
9477 label = "Auto Accept"
95- defaultToggled = { this . state . autoOk }
78+ toggled = { this . state . autoOk }
9679 onToggle = { this . handleToggle }
9780 />
9881 < Toggle
9982 name = "disableYearSelection"
10083 value = "disableYearSelection"
10184 label = "Disable Year Selection"
102- defaultToggled = { this . state . disableYearSelection }
85+ toggled = { this . state . disableYearSelection }
10386 onToggle = { this . handleToggle }
10487 />
10588 </ div >
0 commit comments