nazar-pc / PickMeUp

Really simple, powerful, customizable and lightweight standalone datepicker
BSD Zero Clause License
615 stars 191 forks source link

Can't prevent showing days not in month #165

Closed almazdanilov closed 7 years ago

almazdanilov commented 7 years ago

Is there any configuration option to prevent days not in month from showing? Hiding them via CSS is not good idea.

nazar-pc commented 7 years ago

Hiding them via CSS is not a good idea, it is a perfect one! This is exactly the kind of task CSS exists for, don't try to use JavaScript where it is not necessary.

almazdanilov commented 7 years ago

As I understood, there is no undocumented option available in your script for hiding days not in month. Perfect solution is to make option like {daysnm : false}. At this time your script generates 14! excess DOM objects in February. Render function processes those objects and CSS-hiding is not a solution. I agree with You to don't use javascript where it is not necessary. But this phraze is not suitable for this situation.

nazar-pc commented 7 years ago

There is no such option and will likely never be. 14 plain divs are not a problem at all (feel free to post benchmarks proving the opposite). Each day that is not in coresponding month have a class .pmu-not-in-month, just add one line in CSS to hide such elements and you're done.