Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

feat(onTimespanClick): expose the cell that was clicked for the month…

… or year view

Closes #270
  • Loading branch information...
Matt Lewis
Matt Lewis committed Jan 27, 2016
1 parent 0ffc774 commit 71849603531024c74947a031c19a93e5722f412a
@@ -163,7 +163,7 @@ This expression is called when an event delete link is clicked on the calendar.

### on-timespan-click

This expression is called when a month, day or hour on the calendar is clicked on the year, month and day views respectively. `calendarDate` can be used in the expression and contains the start of the month, day or hour that was clicked on.
This expression is called when a month, day or hour on the calendar is clicked on the year, month and day views respectively. `calendarDate` can be used in the expression and contains the start of the month, day or hour that was clicked on. If on the month or year view `calendarCell` will contain cell data for the clicked day or month which you can then modify.

### cell-is-open

@@ -38,6 +38,7 @@ angular
if (!dayClickedFirstRun) {
vm.onTimespanClick({
calendarDate: day.date.toDate(),
calendarCell: day,
$event: $event
});
if ($event && $event.defaultPrevented) {
@@ -29,6 +29,7 @@ angular
if (!monthClickedFirstRun) {
vm.onTimespanClick({
calendarDate: month.date.toDate(),
calendarCell: month,
$event: $event
});
if ($event && $event.defaultPrevented) {
@@ -115,7 +115,8 @@ describe('mwlCalendarMonth directive', function() {
expect(MwlCalendarCtrl.openDayIndex).to.equal(0);
expect(showModal).to.have.been.calledWith('Day clicked', {
calendarDate: MwlCalendarCtrl.view[0].date.toDate(),
$event: undefined
$event: undefined,
calendarCell: MwlCalendarCtrl.view[0]
});

//Close event list
@@ -106,7 +106,8 @@ describe('mwlCalendarYear directive', function() {
expect(MwlCalendarCtrl.openMonthIndex).to.equal(0);
expect(showModal).to.have.been.calledWith('Day clicked', {
calendarDate: MwlCalendarCtrl.view[0].date.toDate(),
$event: undefined
$event: undefined,
calendarCell: MwlCalendarCtrl.view[0]
});

//Close event list

1 comment on commit 7184960

@diguifi

This comment has been minimized.

Copy link

diguifi commented on 7184960 May 23, 2018

Such a simple commit for such powerful feature.

Please sign in to comment.
You can’t perform that action at this time.