react-datepicker icon indicating copy to clipboard operation
react-datepicker copied to clipboard

formatWeekNumber does no longer allow `string` return value

Open pciarach opened this issue 1 year ago • 0 comments

Describe the bug Currently formatWeekNumber function has following signature: formatWeekNumber: (date: Date) => number; Before version 7.0, @types/react-datepicker package had following signature: formatWeekNumber?(date: Date): string | number;

To Reproduce Try to pass format function which returns string to the formatWeekNumber prop. TS error is raised.

Expected behavior Format function allows both number and string types to be returned

Additional context As far as I can see in code, the change might be straightforward but it may break the code for the users that adjusted their onWeekSelect callback after version 7.0 came out.

pciarach avatar Aug 14 '24 13:08 pciarach