File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed
Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -198,14 +198,15 @@ export default class DateInput extends React.Component {
198198 return this . state . value ;
199199 } ;
200200
201- getCurrentDate = ( ) =>
202- parseValue (
203- this . props . value !== undefined
201+ getCurrentDate = ( ) => {
202+ // If value prop is provided and not empty, use it
203+ // Otherwise, use state.value if available, or fall back to initialCalendarDate
204+ const valueToUse =
205+ this . props . value !== undefined && this . props . value !== ''
204206 ? this . props . value
205- : this . state . value || this . props . initialCalendarDate ,
206- this . props . dateFormat ,
207- this . props . parse
208- ) ;
207+ : this . state . value || this . props . initialCalendarDate ;
208+ return parseValue ( valueToUse , this . props . dateFormat , this . props . parse ) ;
209+ } ;
209210
210211 parseInput = ( value ) => {
211212 const date = this . props . parse ( value , this . props . dateFormat ) ;
You can’t perform that action at this time.
0 commit comments