kbwood / datepick

jQuery Datepicker Plugin
87 stars 39 forks source link

multiSelect and rangeSelect a week don't work together #30

Open Wikinaut opened 9 years ago

Wikinaut commented 9 years ago

I wanted to be able to i) select single days by clicking onto ad date, or ii) a whole week by clicking onto the week number, and later to iii) deselect single days from a (as a whole) selected week.

The following is combined from your examples but it does not work as expected, which makes the content of this formal bug issue:

$("#calendar").datepick({
    renderer: $.datepick.weekOfYearRenderer, 
    firstDay: 1,
    showOtherMonths: true,
    rangeSelect: true, 
    onShow: $.datepick.selectWeek,
    multiSelect: 999,
    showTrigger: '#calImg'
    });

So what I basically suggest is also a redesign (improvement) of your datepicker, so that multiple and single dates, and ranges from ... to ... can be selected.

A working library for detecting keycodes is https://github.com/jeresig/jquery.hotkeys - so that Shift-and-left-mouse-click and also Ctrl-and-left-mouse-click actions could be detected and used for selecting (or deselecting) ranges, week, or single days.

If needed, I can write a formal issue with a concrete proposal. With the current version, it's not easy to code for non-experts, but once we have a working example, your extension, which already has a lot of useful option but lacks the described features, will become the best of the multi-date-pickers.