#9679 closed enhancement (fixed)
[patch] [cla] Allow Calendar to select multiple dates
Reported by: | Jean-Rubin Leonard | Owned by: | Adam Peller |
---|---|---|---|
Priority: | high | Milestone: | 1.7 |
Component: | DojoX Widgets | Version: | 1.3.2 |
Keywords: | multiple date calendar dateTextBox | Cc: | David Schwartz, Douglas Hays |
Blocked By: | Blocking: |
Description (last modified by )
Currently the datepicker allows to select only one date and it returns the data to the underlying text box. A functionality that is missing and that is very useful is the ability to select multiple dates. I agree this should probably not be a text box as the result of selecting multiple dates should probably be an array or a JSON hash. This should probably be a new dijit or control. The functionality is present in jquery or yahoo library. It would be awesome to have it in Dojo as well. Possible features:
- give user the option to specify dates that should start selected (based on day of week, week-end, weekdays)
- give user the option to specify the end and start date of the calendar
Attachments (13)
Change History (47)
comment:1 Changed 11 years ago by
comment:3 Changed 11 years ago by
Milestone: | tbd → 1.5 |
---|
comment:4 Changed 11 years ago by
Is this still on track for 1.5? Just checking as there hasn't been any updates in a while.
comment:5 Changed 11 years ago by
no promises, I'm afraid. If anyone is free to work on this or has patches, it would be great to have. I will try to work on it before the 1.5 release.
comment:6 Changed 11 years ago by
Milestone: | 1.5 → 1.6 |
---|
comment:7 Changed 11 years ago by
Summary: | Allow dateTextBox to select multiple dates → Allow Calendar to select multiple dates |
---|
Several different things here... multiple selection might be easiest to achieve on the Calendar widget itself. How to represent this in a textbox is a separate problem and part of that depends on whether we're talking about contiguous ranges or individual dates. Side-by-side calendars: see #7985 Not sure whether this would all come together in a super configurable DateTextBox? type of widget or specialized widgets.
comment:8 Changed 11 years ago by
Cc: | David Schwartz Douglas Hays added |
---|
comment:9 Changed 11 years ago by
Description: | modified (diff) |
---|
Changed 11 years ago by
Attachment: | calendarClaro.diff added |
---|
Changed 11 years ago by
Attachment: | calendarNihilo.diff added |
---|
Changed 11 years ago by
Attachment: | calendarSoria.diff added |
---|
Changed 11 years ago by
Attachment: | calendarTundra.diff added |
---|
Changed 11 years ago by
Attachment: | dojoxMods.diff added |
---|
comment:10 Changed 11 years ago by
Modifications brought to dojoxMods.diff. This patch can now be enabled.
Changed 11 years ago by
Attachment: | newCalendar.diff added |
---|
comment:11 Changed 11 years ago by
all the other attachments can be ignored except for newCalendar.diff, which contains the new code for the multiSelectCalendar, the multiSelectCalendarButton and the multiSelectCalendar.css file.
Changed 11 years ago by
Attachment: | testMultiSelectCalendar.html added |
---|
comment:12 Changed 11 years ago by
Minor housekeeping: patch file should have the paths worked out relative to the dojo base (test file has "js/", css file is in the js dir and is not capitalized, etc.) Did we decide to make the button part of the test for now and not a public JS module?
Changed 10 years ago by
Attachment: | calendar2.diff added |
---|
comment:13 Changed 10 years ago by
Corrected parseInt bug. The radix was missing. Replaced ParseInt? with Number.
comment:14 Changed 10 years ago by
Component: | Date → Dijit |
---|---|
Owner: | Adam Peller deleted |
comment:15 Changed 10 years ago by
Component: | Dijit → DojoX Widgets |
---|---|
Owner: | set to dante |
Summary: | Allow Calendar to select multiple dates → [patch] [cla] Allow Calendar to select multiple dates |
I agree this would be useful for some apps but I don't think a common enough control for dijit. The patch file is actually for dojox.widget and I agree it should go there (if anywhere).
comment:16 Changed 10 years ago by
Owner: | changed from dante to Adam Peller |
---|
comment:17 Changed 10 years ago by
I think this feature is quite significant to bring the calendar's functionality an par with other js frameworks. Is it targeted for calendar multiselect to land on 1.6 ? Regards.
comment:18 follow-up: 20 Changed 10 years ago by
My work was submitted but I think rejected. Maybe if you Plus one (+1) it might make a difference. JR
comment:20 Changed 10 years ago by
Replying to simpli:
My work was submitted but I think rejected. Maybe if you Plus one (+1) it might make a difference. JR
Do you patch is compatible with the 1.6 release and if not, would it be a lot of work to bring it forward ?
comment:21 Changed 10 years ago by
I haven't updated to 1.6 yet so I couldn't tell. I'm not sure of the extent of stuff that changed in 1.6 either. I can't answer at the moment. JR
comment:22 Changed 10 years ago by
@simpli, sorry I've neglected this one. Is there a single unified diff? If not, which patches am I supposed to use again?
comment:23 Changed 10 years ago by
I applied calendar2.diff and also the test, which should be placed at dojox/widget/tests. The patch does not run against trunk. Unfortunately, there were significant changes to dijit.Calendar which need to be merged. For future releases, we should see if there's a way dijit.Calendar could be restructured to make call outs so we don't have to duplicate so much code.
comment:24 Changed 10 years ago by
I think it was meant to be a new widget altogether that extended calendar. I'll be hanging around #dojo in the next few days to see how I can help.
comment:25 Changed 10 years ago by
Milestone: | 1.6 → 1.7 |
---|
Changed 10 years ago by
Attachment: | mSC.2.diff added |
---|
comment:26 Changed 10 years ago by
Submmited modified source file with some editing as well as a test file as per wildbill request. JR
comment:27 Changed 10 years ago by
The test file needs to have paths that match up against the directory structure. Some simple instructions to test might be useful in the absence of automated tests. You might try copying one of the files from dojox/widget. patch files are best to show file location.
We're still sharing dijit templates, but we've forked from dijit logic. Perhaps this is the most pragmatic thing to do, but it's still fragile. If we're going to fork, should we fork both? What does wildbill think?
A couple minor things:
- should declare dojo.experimental
- many values can be moved out of the prototype into the object instance, especially if they're not intended to be 'public API' (e.g. currentMonth) and the null initializers are unnecessary in any event.
- bedlumped named "_" should be used for new methods which are not intended to be public API.
- avoid using dojo.date.format for non-i18n related calculations when simple string concat will be much faster
- can remove deprecated setValue
Changed 10 years ago by
comment:28 Changed 10 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
(In [24741]) MultiSelectCalendar? from Jean-Rubin Leonard. Forked dijit.Calendar code, for now. Experimental. Fixes #9679 \!strict
comment:29 Changed 10 years ago by
A couple of observations - the dropdownmenu code was called "dijit.Calendar..." in the patch and would have collided with the dijit.Calendar code, so I renamed it. The "T00:00:00" passed to Date constructors assumes ES5 which is not available in all browsers. For just those two lines of code, you may wish to use the old Date API.
comment:30 Changed 10 years ago by
Select May 9. Then, select the range May 1-May20. May 9 gets deselected in the middle of the range. I would have expected it to stay selected as part of the new range. Bug or intentional behavior? Also, shift+arrow might be good to support as the equivalent of shift-click.
comment:31 Changed 10 years ago by
The behavior is intentional. When we select a range everything in that range is toggled. If the date was already selected it will remove it from the selection. JR As for the dijit.Calendar, that was a mistake. Thanks for having corrected it.
Changed 10 years ago by
comment:32 Changed 10 years ago by
patch to revert to old date API to avoid issue due to the lack of support of ES5 in some browsers.
comment:33 Changed 10 years ago by
if selectedDates[0] is a String of the form yyyy-MM-dd and you wish to convert it to a Date object, just call dojo.date.stamp.fromISOString()
Changed 10 years ago by
Attachment: | msc2.2.diff added |
---|
This is an example of multi-select functionality: http://www.kelvinluck.com/assets/jquery/datePicker/v2/demo/datePickerMultiple.html
The Example of 3 calendars put side by side on this page http://www.eyecon.ro/datepicker/ is also something neat that could be implemented.