nazar-pc / PickMeUp

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

In multiple select can I limit only 2 or 3 day select? #176

Closed maisreymom closed 6 years ago

nazar-pc commented 7 years ago

There is no such option out of the box, but there is a possibility to implement this using existing API.

There is a render callback. You can check in this callback if enough dates were selected and simply mark the rest of dates as disabled.

Rendering happens on any change, so this is very flexible way to apply any custom logic like limit of 2 or 3 days as you need.

maisreymom commented 7 years ago

I try to use this: var now = new Date; pickmeup(element, { render : function (date) { if (date < now) { return {disabled : true, class_name : 'date-in-past'}; } return {}; } }) but it not work. Excuse me sir, In multiple mode is it possible to click one time but can select multiple date?

nazar-pc commented 7 years ago

Yes, it is possible, just look at readme and available options. Also if something doesn't work like you think it should, then make a live demo, please: https://github.com/nazar-pc/PickMeUp#contribution