This repository was archived by the owner on Nov 16, 2018. It is now read-only.
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({
117117 return this . setState ( {
118118 selectedDate : this . state . selectedDate . clone ( ) . add ( 1 , "minutes" )
119119 } , 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+ } ) ;
121124 } ) ;
122125 } ,
123126 addHour : function ( ) {
124127 return this . setState ( {
125128 selectedDate : this . state . selectedDate . clone ( ) . add ( 1 , "hours" )
126129 } , 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+ } ) ;
128134 } ) ;
129135 } ,
130136 addMonth : function ( ) {
@@ -146,14 +152,20 @@ DateTimeField = React.createClass({
146152 return this . setState ( {
147153 selectedDate : this . state . selectedDate . clone ( ) . subtract ( 1 , "minutes" )
148154 } , 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+ } ) ;
150159 } ) ;
151160 } ,
152161 subtractHour : function ( ) {
153162 return this . setState ( {
154163 selectedDate : this . state . selectedDate . clone ( ) . subtract ( 1 , "hours" )
155164 } , 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+ } ) ;
157169 } ) ;
158170 } ,
159171 subtractMonth : function ( ) {
You can’t perform that action at this time.
0 commit comments