Here is an example of a context menu used for time range selection:
<DayPilot:DayPilotMenu ID="DayPilotMenuSelection" runat="server" CssClassPrefix="menu_default">
<DayPilot:MenuItem Action="JavaScript" JavaScript="dpc1.timeRangeSelectedCallBack(e.start, e.end, e.resource); dpc1.clearSelection();"
Text="Create new event (JavaScript)" />
<DayPilot:MenuItem Action="PostBack" Command="Insert" Text="Create new event (PostBack)" />
<DayPilot:MenuItem Action="CallBack" Command="Insert" Text="Create new event (CallBack)" />
<DayPilot:MenuItem Text="-" ></DayPilot:MenuItem>
<DayPilot:MenuItem Action="JavaScript" JavaScript="if (!copied) { alert('You need to copy an event first.'); return; } dpc1.commandCallBack('paste', {id:copied, start: e.start});" Text="Paste" />
<DayPilot:MenuItem Text="-" ></DayPilot:MenuItem>
<DayPilot:MenuItem Action="JavaScript" JavaScript="alert('Start: ' + e.start.toString() + '\nEnd: ' + e.end.toString() + '\nResource id: ' + e.resource);"
Text="Show selection details" />
<DayPilot:MenuItem Action="JavaScript" JavaScript="dpc1.clearSelection();"
Text="Clean selection" />
</DayPilot:DayPilotMenu>
You can access the selection properties using e.start, e.end and e.resource.
See also:
http://doc.daypilot.org/calendar/time-range-context-menu/