File tree Expand file tree Collapse file tree 1 file changed +16
-4
lines changed Expand file tree Collapse file tree 1 file changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -117,14 +117,20 @@ DateTimeField = React.createClass({
117
117
return this . setState ( {
118
118
selectedDate : this . state . selectedDate . clone ( ) . add ( 1 , "minutes" )
119
119
} , function ( ) {
120
- return this . props . onChange ( this . state . selectedDate . format ( this . props . format ) ) ;
120
+ this . props . onChange ( this . state . selectedDate . format ( this . props . format ) ) ;
121
+ return this . setState ( {
122
+ inputValue : this . state . selectedDate . format ( this . props . inputFormat )
123
+ } ) ;
121
124
} ) ;
122
125
} ,
123
126
addHour : function ( ) {
124
127
return this . setState ( {
125
128
selectedDate : this . state . selectedDate . clone ( ) . add ( 1 , "hours" )
126
129
} , function ( ) {
127
- return this . props . onChange ( this . state . selectedDate . format ( this . props . format ) ) ;
130
+ this . props . onChange ( this . state . selectedDate . format ( this . props . format ) ) ;
131
+ return this . setState ( {
132
+ inputValue : this . state . selectedDate . format ( this . props . inputFormat )
133
+ } ) ;
128
134
} ) ;
129
135
} ,
130
136
addMonth : function ( ) {
@@ -146,14 +152,20 @@ DateTimeField = React.createClass({
146
152
return this . setState ( {
147
153
selectedDate : this . state . selectedDate . clone ( ) . subtract ( 1 , "minutes" )
148
154
} , function ( ) {
149
- return this . props . onChange ( this . state . selectedDate . format ( this . props . format ) ) ;
155
+ this . props . onChange ( this . state . selectedDate . format ( this . props . format ) ) ;
156
+ return this . setState ( {
157
+ inputValue : this . state . selectedDate . format ( this . props . inputFormat )
158
+ } ) ;
150
159
} ) ;
151
160
} ,
152
161
subtractHour : function ( ) {
153
162
return this . setState ( {
154
163
selectedDate : this . state . selectedDate . clone ( ) . subtract ( 1 , "hours" )
155
164
} , function ( ) {
156
- return this . props . onChange ( this . state . selectedDate . format ( this . props . format ) ) ;
165
+ this . props . onChange ( this . state . selectedDate . format ( this . props . format ) ) ;
166
+ return this . setState ( {
167
+ inputValue : this . state . selectedDate . format ( this . props . inputFormat )
168
+ } ) ;
157
169
} ) ;
158
170
} ,
159
171
subtractMonth : function ( ) {
You can’t perform that action at this time.
0 commit comments