-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Description
Expected Behavior
get periodButtonText(): string {
if (this.calendar.currentView == 'month') {
return this._dateAdapter
.format(this.calendar.activeDate, this._dateFormats.display.monthYearLabel)
.toLocaleUpperCase();
}
if (this.calendar.currentView == 'year') {
return this._dateAdapter.getYearName(this.calendar.activeDate);
}
const activeYear = this._dateAdapter.getYear(this.calendar.activeDate);
const firstYearInView = this._dateAdapter.getYearName(
this._dateAdapter.createDate(activeYear - activeYear % 24, 0, 1));
const lastYearInView = this._dateAdapter.getYearName(
this._dateAdapter.createDate(activeYear + yearsPerPage - 1 - activeYear % 24, 0, 1));
return ${firstYearInView} \u2013 ${lastYearInView}
;
}
Actual Behavior
get periodButtonText(): string {
if (this.calendar.currentView == 'month') {
return this._dateAdapter
.format(this.calendar.activeDate, this._dateFormats.display.monthYearLabel)
.toLocaleUpperCase();
}
if (this.calendar.currentView == 'year') {
return this._dateAdapter.getYearName(this.calendar.activeDate);
}
const activeYear = this._dateAdapter.getYear(this.calendar.activeDate);
const minYearOfPage = activeYear - getActiveOffset(
this._dateAdapter, this.calendar.activeDate, this.calendar.minDate, this.calendar.maxDate);
const maxYearOfPage = minYearOfPage + yearsPerPage - 1;
return `${minYearOfPage} \u2013 ${maxYearOfPage}`;
}
What behavior did you actually see?
- Look at firstYearInView and lastYearInView on version 6 has getYearName() but version 8 doesn't
that make some locale time display is unusual.