Skip to content

Bug: DayPickerInput, changing month in captionElement with selected value will be ignored #425

@Cagyo

Description

@Cagyo

To reproduce the error, in DayPickerInput select any day and after change month or year by selecting it in captionElement - month and year will remain unchanged.

https://jsfiddle.net/pbsbyo72/2/

The problem is in getStateFromProps function:
const m = moment(props.value, props.format, true); if (m.isValid()) { month = m.toDate(); }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions