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 @@ -37,9 +37,9 @@ DateTimeField = React.createClass({
3737 } ,
3838 componentWillReceiveProps : function ( nextProps ) {
3939 return this . setState ( {
40- viewDate : moment ( nextProps . dateTime ) . startOf ( "month" ) ,
41- selectedDate : moment ( nextProps . dateTime ) ,
42- inputValue : moment ( nextProps . dateTime ) . format ( nextProps . inputFormat )
40+ viewDate : moment ( nextProps . dateTime , nextProps . format ) . startOf ( "month" ) ,
41+ selectedDate : moment ( nextProps . dateTime , nextProps . format ) ,
42+ inputValue : moment ( nextProps . dateTime , nextProps . format ) . format ( nextProps . inputFormat )
4343 } ) ;
4444 } ,
4545 onChange : function ( event ) {
@@ -58,7 +58,7 @@ DateTimeField = React.createClass({
5858 } ,
5959 setSelectedDate : function ( e ) {
6060 return this . setState ( {
61- selectedDate : this . state . viewDate . clone ( ) . date ( parseInt ( e . target . innerHTML ) )
61+ selectedDate : this . state . viewDate . clone ( ) . date ( parseInt ( e . target . innerHTML ) ) . hour ( this . state . selectedDate . hours ( ) ) . minute ( this . state . selectedDate . minutes ( ) )
6262 } , function ( ) {
6363 this . closePicker ( ) ;
6464 this . props . onChange ( this . state . selectedDate . format ( this . props . format ) ) ;
You can’t perform that action at this time.
0 commit comments