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 +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -32,9 +32,9 @@ DateTimeField = React.createClass(
3232
3333 componentWillReceiveProps : (nextProps ) ->
3434 @setState
35- viewDate : moment (nextProps .dateTime ).startOf (" month" )
36- selectedDate : moment (nextProps .dateTime )
37- inputValue : moment (nextProps .dateTime ).format (nextProps .inputFormat )
35+ viewDate : moment (nextProps .dateTime , nextProps . format ).startOf (" month" )
36+ selectedDate : moment (nextProps .dateTime , nextProps . format )
37+ inputValue : moment (nextProps .dateTime , nextProps . format ).format (nextProps .inputFormat )
3838
3939 # to improve with detection only onBlur
4040 onChange : (event ) ->
@@ -49,7 +49,7 @@ DateTimeField = React.createClass(
4949 @props .onChange (@state .selectedDate .format (@props .format ))
5050
5151 setSelectedDate : (e ) ->
52- @ setState selectedDate : @state .viewDate .clone ().date (parseInt (e .target .innerHTML )), ->
52+ @ setState selectedDate : @state .viewDate .clone ().date (parseInt (e .target .innerHTML )). hour ( @state . selectedDate . hours ()). minute ( @state . selectedDate . minutes ()) , ->
5353 @ closePicker ()
5454 @props .onChange (@state .selectedDate .format (@props .format ))
5555 @ setState inputValue : @state .selectedDate .format (" MM/DD/YY H:mm A" )
You can’t perform that action at this time.
0 commit comments