day8 / re-com

A ClojureScript library of reusable components for Reagent
https://re-com.day8.com.au
MIT License
796 stars 147 forks source link

datepicker: issues with selectable-fn and getIsoWeekday following update to 2.12 #240

Closed alex314159 closed 3 years ago

alex314159 commented 3 years ago

Thanks again for the great project. Update went smoothly and is very useful, but I have this weird bug in datepicker:

[datepicker-dropdown :model entry-date :selectable-fn #(< (.getIsoWeekday %) 5)] ;only select weekdays

The above worked in the previous version, but now I get Cannot infer target type in expression (. p1__57909# getIsoWeekday)?. What's also strange is that some other goog.time functions such as .getDay work. I've also tried to type hint to ^DateTime but without success.

Thanks for the help,

superstructor commented 3 years ago

I can't answer as to why the behavior changed, maybe you have also upgraded your compiler (shadow-cljs?) at the same time.

I did reproduce the above compiler warning, and fixed it with either of the following both working:

#(< (.getIsoWeekday ^js %) 5)

or

#(< (.getIsoWeekday ^js/DateTime %) 5)
alex314159 commented 3 years ago

you're right I had updated shadow-cljs, too! Thanks for the tip that worked!