File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed
packages/pf3-component-mapper
src/form-fields/date-time-picker Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -431,6 +431,7 @@ const output = {
431
431
title : 'Datepicker with past days' ,
432
432
component : components . DATE_PICKER ,
433
433
variant : 'date-time' ,
434
+ initialValue : '2019-11-04T12:31:00.000Z' ,
434
435
} ,
435
436
] ,
436
437
component : components . SUB_FORM ,
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ export class DateTimePicker extends React.Component {
31
31
super ( props ) ;
32
32
this . state = {
33
33
positionLeft : 0 ,
34
- selectedDay : props . value ,
34
+ selectedDay : typeof props . value === 'string' ? new Date ( props . value ) : props . value ,
35
35
selectingMonth : false ,
36
36
selectingYear : false ,
37
37
isOpen : false ,
@@ -169,7 +169,7 @@ DateTimePicker.propTypes = {
169
169
showTodayButton : PropTypes . bool ,
170
170
isDisabled : PropTypes . bool ,
171
171
disabledDays : PropTypes . array ,
172
- value : PropTypes . instanceOf ( Date ) ,
172
+ value : PropTypes . oneOfType ( [ PropTypes . instanceOf ( Date ) , PropTypes . string ] ) ,
173
173
closeOnDaySelect : PropTypes . bool ,
174
174
onChange : PropTypes . func . isRequired ,
175
175
isClearable : PropTypes . bool ,
You can’t perform that action at this time.
0 commit comments