Skip to content

"renderYearContent" unavailable in proptypes #4750

@kalpesh-coditas

Description

@kalpesh-coditas

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"
    />
  );
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions