Whether the given month is enabled.
(month: number)
| 365 | |
| 366 | /** Whether the given month is enabled. */ |
| 367 | private _shouldEnableMonth(month: number) { |
| 368 | const activeYear = this._dateAdapter.getYear(this.activeDate); |
| 369 | |
| 370 | if ( |
| 371 | month === undefined || |
| 372 | month === null || |
| 373 | this._isYearAndMonthAfterMaxDate(activeYear, month) || |
| 374 | this._isYearAndMonthBeforeMinDate(activeYear, month) |
| 375 | ) { |
| 376 | return false; |
| 377 | } |
| 378 | |
| 379 | if (!this.dateFilter) { |
| 380 | return true; |
| 381 | } |
| 382 | |
| 383 | const firstOfMonth = this._dateAdapter.createDate(activeYear, month, 1); |
| 384 | |
| 385 | // If any date in the month is enabled count the month as enabled. |
| 386 | for ( |
| 387 | let date = firstOfMonth; |
| 388 | this._dateAdapter.getMonth(date) == month; |
| 389 | date = this._dateAdapter.addCalendarDays(date, 1) |
| 390 | ) { |
| 391 | if (this.dateFilter(date)) { |
| 392 | return true; |
| 393 | } |
| 394 | } |
| 395 | |
| 396 | return false; |
| 397 | } |
| 398 | |
| 399 | /** |
| 400 | * Tests whether the combination month/year is after this.maxDate, considering |
no test coverage detected