react-datepicker
react-datepicker copied to clipboard
formatWeekNumber does no longer allow `string` return value
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.