|
83 | 83 |
|
84 | 84 | /** |
85 | 85 | * Creates a single cell to contain a year in the calendar. |
86 | | - * @param {number} opt_year Four-digit year. |
87 | | - * @param {number} opt_month Zero-indexed month. |
| 86 | + * @param {number} year Four-digit year. |
| 87 | + * @param {number} month Zero-indexed month. |
88 | 88 | * @returns {HTMLElement} |
89 | 89 | */ |
90 | 90 | CalendarYearBodyCtrl.prototype.buildMonthCell = function(year, month) { |
|
98 | 98 | cell.id = calendarCtrl.getDateId(firstOfMonth, 'year'); |
99 | 99 |
|
100 | 100 | // Use `data-timestamp` attribute because IE10 does not support the `dataset` property. |
101 | | - cell.setAttribute('data-timestamp', firstOfMonth.getTime()); |
| 101 | + cell.setAttribute('data-timestamp', String(firstOfMonth.getTime())); |
102 | 102 |
|
103 | 103 | if (this.dateUtil.isSameMonthAndYear(firstOfMonth, calendarCtrl.today)) { |
104 | 104 | cell.classList.add(calendarCtrl.TODAY_CLASS); |
|
112 | 112 |
|
113 | 113 | var cellText = this.dateLocale.shortMonths[month]; |
114 | 114 |
|
115 | | - if (this.dateUtil.isMonthWithinRange(firstOfMonth, |
116 | | - calendarCtrl.minDate, calendarCtrl.maxDate)) { |
| 115 | + if (this.dateUtil.isMonthWithinRange( |
| 116 | + firstOfMonth, calendarCtrl.minDate, calendarCtrl.maxDate) && |
| 117 | + (!angular.isFunction(this.calendarCtrl.dateFilter) || |
| 118 | + this.calendarCtrl.dateFilter(firstOfMonth))) { |
117 | 119 | var selectionIndicator = document.createElement('span'); |
118 | 120 | selectionIndicator.classList.add('md-calendar-date-selection-indicator'); |
119 | 121 | selectionIndicator.textContent = cellText; |
120 | 122 | cell.appendChild(selectionIndicator); |
121 | 123 | cell.addEventListener('click', yearCtrl.cellClickHandler); |
122 | 124 |
|
123 | | - if (calendarCtrl.displayDate && this.dateUtil.isSameMonthAndYear(firstOfMonth, calendarCtrl.displayDate)) { |
| 125 | + if (calendarCtrl.displayDate && |
| 126 | + this.dateUtil.isSameMonthAndYear(firstOfMonth, calendarCtrl.displayDate)) { |
124 | 127 | this.focusAfterAppend = cell; |
125 | 128 | } |
126 | 129 | } else { |
|
133 | 136 |
|
134 | 137 | /** |
135 | 138 | * Builds a blank cell. |
136 | | - * @return {HTMLTableCellElement} |
| 139 | + * @return {HTMLElement} |
137 | 140 | */ |
138 | 141 | CalendarYearBodyCtrl.prototype.buildBlankCell = function() { |
139 | 142 | var cell = document.createElement('td'); |
|
0 commit comments