File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
components/SLDSDatepickerSingleSelect Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -135,9 +135,19 @@ module.exports = React.createClass({
135
135
}
136
136
} ,
137
137
138
+ parseDate ( strValue ) {
139
+ const d = this . props . parser ( strValue ) ;
140
+ if ( Object . prototype . toString . call ( d ) === "[object Date]" ) {
141
+ if ( ! isNaN ( d . getTime ( ) ) ) {
142
+ return d ;
143
+ }
144
+ }
145
+ return new Date ( ) ;
146
+ } ,
147
+
138
148
popover ( ) {
139
149
if ( this . state && this . state . isOpen ) {
140
- const date = this . state . strValue ?this . props . parser ( this . state . strValue ) :this . state . value ;
150
+ const date = this . state . strValue ?this . parseDate ( this . state . strValue ) :this . state . value ;
141
151
return < SLDSPopover className = 'slds-dropdown' targetElement = { this . refs . date } onClose = { this . handleClose } >
142
152
< SLDSDatePicker
143
153
onChange = { this . handleChange }
You can’t perform that action at this time.
0 commit comments