Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

formatWeekNumber does no longer allow string return value #5034

Open
pciarach opened this issue Aug 14, 2024 · 0 comments
Open

formatWeekNumber does no longer allow string return value #5034

pciarach opened this issue Aug 14, 2024 · 0 comments

Comments

@pciarach
Copy link

pciarach commented Aug 14, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant