Hacker0x01 / react-datepicker

A simple and reusable datepicker component for React
https://reactdatepicker.com/
MIT License
8.06k stars 2.24k forks source link

"renderYearContent" unavailable in proptypes #4750

Open kalpesh-coditas opened 5 months ago

kalpesh-coditas commented 5 months ago

I am trying customise year text and in docs "renderYearContent" prop is given to do so but actually this prop is not available in proptypes of react datepicker, is there any workaround for this ??

() => {
  const renderYearContent = (year) => {
    const tooltipText = `Tooltip for year: ${year}`;
    return <span title={tooltipText}>{year}</span>;
  };
  return (
    <DatePicker
      selected={new Date()}
      renderYearContent={renderYearContent}
      showYearPicker
      dateFormat="yyyy"
    />
  );
};
mirus-ua commented 5 months ago

I hope will be handled here https://github.com/Hacker0x01/react-datepicker/issues/4700