https://github.com/wojtekmaj/react-calendar/blob/master/src/MonthView/Weekdays.jsx#L63
The function signature have changed at some point from (date, ...) to (locale, date). The readme still says (date)
PS: I've only checked formatShortWeekday, but I assume the signatures are uniform.
Cheers :)
Hi. First of all, thank you for all your good work on this. It has been a pleasure to be able to use this piece of software.
I'm also experiencing this issue.
I'm using react-date-picker version 7.0.0 with a dependency of react-calendar: "^2.17.4". Following the latest release it now installs 2.18.0 resulting in the following error:
Uncaught TypeError: Cannot read property 'replace' of undefined at Weekdays.render (Weekdays.js:85)
If I change my formatShortWeekday(selectedDate) to formatShortWeekday(locale, selectedDate) typescript complains about the type error TS2322: Type '(locale: any, selectedDate: any) => string' is not assignable to type 'FormatterCallback'.. I could be wrong, but this suggests that the signature might not been adjusted to the changes from 2.17.4 to 2.18.0. This also corresponds to index.d.ts line 6
@olejorgenb @teltploek Fixed that in 7014cce :) Please kindly verify the changes if they look right (I'm not an expert in TypeScript, I must admit). If everything looks well, I'll be happy to push a hotfix.
Thank you. Looks good from where I'm sitting :-)
Most helpful comment
@olejorgenb @teltploek Fixed that in 7014cce :) Please kindly verify the changes if they look right (I'm not an expert in TypeScript, I must admit). If everything looks well, I'll be happy to push a hotfix.