Whether the two dates represent the same view in the current view mode (month or year).
(date1: D, date2: D)
| 189 | |
| 190 | /** Whether the two dates represent the same view in the current view mode (month or year). */ |
| 191 | private _isSameView(date1: D, date2: D): boolean { |
| 192 | if (this.calendar.currentView == 'month') { |
| 193 | return ( |
| 194 | this._dateAdapter.getYear(date1) == this._dateAdapter.getYear(date2) && |
| 195 | this._dateAdapter.getMonth(date1) == this._dateAdapter.getMonth(date2) |
| 196 | ); |
| 197 | } |
| 198 | if (this.calendar.currentView == 'year') { |
| 199 | return this._dateAdapter.getYear(date1) == this._dateAdapter.getYear(date2); |
| 200 | } |
| 201 | // Otherwise we are in 'multi-year' view. |
| 202 | return isSameMultiYearView( |
| 203 | this._dateAdapter, |
| 204 | date1, |
| 205 | date2, |
| 206 | this.calendar.minDate, |
| 207 | this.calendar.maxDate, |
| 208 | ); |
| 209 | } |
| 210 | |
| 211 | /** |
| 212 | * Format two individual labels for the minimum year and maximum year available in the multi-year |
no test coverage detected