Skip to content

Commit

Permalink
refactor(material/datepicker): update comparisonDateLabel value
Browse files Browse the repository at this point in the history
Updates previous fix to remove - for Ids in calendar-body.ts and
revises comparisonDateLabel value to be Comparison range as
recommended.

Fixes b/195600299
  • Loading branch information
essjay05 committed Oct 30, 2024
1 parent d041d3a commit 44499b2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/material/datepicker/calendar-body.ts
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ export class MatCalendarBody<D = any> implements OnChanges, OnDestroy, AfterView

if (this.comparisonStart !== null && this.comparisonEnd !== null) {
if (value === this.comparisonStart && value === this.comparisonEnd) {
return `${this._comparisonStartLabelId}-${this._comparisonEndLabelId}`;
return `${this._comparisonStartLabelId} ${this._comparisonEndLabelId}`;
} else if (value === this.comparisonStart) {
return this._comparisonStartLabelId;
} else if (value === this.comparisonEnd) {
Expand Down
2 changes: 1 addition & 1 deletion src/material/datepicker/datepicker-intl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export class MatDatepickerIntl {
* A label used to indicate that the date is part of a selected comparison
* sub range of dates (used by screen readers).
*/
comparisonDateLabel = 'Sub range';
comparisonDateLabel = 'Comparison range';

/** Formats a range of years (used for visuals). */
formatYearRange(start: string, end: string): string {
Expand Down

0 comments on commit 44499b2

Please sign in to comment.