Skip to content

problem of years #4003

Answered by aziyatali
Chino70 asked this question in Q&A
Discussion options

You must be logged in to vote

@Chino70
You should specify the selected props.
Something like this:


const [selectedDate, setSelectedDate] = useState(new Date());

  return (
    <DatePicker
      style={{ width: '100%' }}
      className="form-control"
      locale="es"
      peekNextMonth
      showYearDropdown
      showMonthDropdown
      disabledKeyboardNavigation
      dateFormat="dd/MM/yyyy"
      selected={selectedDate}
      onChange={(date) => setSelectedDate(date)}
      {...props}
    />
  );

If it resolves your problem, please specify as resolved

Replies: 4 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by Chino70
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants