Calendar doesn't receive event when empty slot is clicked

As far as I understand (also seen in the
demo sources
) the Calendar addon should fire a
RangeSelectEvent
when either the mouse is dragged onto the component to select a range, or the user clicks on an empty slot in the calendar.

I added my own handler with
setHandler(RangeSelectHandler)
but it is not called when empty cells are clicked in the week and day views. I don’t think the fault is on my part because the monthly view works as expected, and the event is always fired when a range is selected via mouse dragging, even when in weekly/daily view.

So, the only thing that doesn’t work is clicking on empty slots in week/day views. I’m using version 2.0.0 of the addon.

There’s ticket
#8883
about this. Clicking on a slot in the day view should fire either a RangeSelectEvent or DateClickEvent, but it doesn’t.

It’s a bit unclear which event should be generated more logically. I’d agree with John in the ticket - selecting date range is different from clicking within a date, even though DateClickEvent is primarily meant for the month view. If you use the same handler to handle clicks both in the month and day views, it could get confusing. Maybe there should be a TimeClickEvent or something.

Thinking more about this, DateClickEvent should probably not be reused for this, because of the reasons mentioned in the ticket.

I think a
RangeSelectEvent
wouldn’t be wrong - but I think a viable option would be a
EmptySlotClicked
event with the same fields (ie, a start and end instant)