Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: remove datepickerToggle fallback common string property #445

Merged
merged 1 commit into from
Jan 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 0 additions & 2 deletions projects/angular/clarity.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -914,8 +914,6 @@ export interface ClrCommonStrings {
// (undocumented)
datepickerSelectYearText: string;
// (undocumented)
datepickerToggle: string;
// (undocumented)
datepickerToggleChangeDateLabel: string;
// (undocumented)
datepickerToggleChooseDateLabel: string;
Expand Down
10 changes: 4 additions & 6 deletions projects/angular/src/forms/datepicker/date-container.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,13 +187,11 @@ export class ClrDateContainer extends ClrAbstractContainer implements AfterViewI
if (day) {
const formattedDate = this.dateIOService.toLocaleDisplayFormatString(day.toDate());

return (
this.commonStrings.parse(this.commonStrings.keys.datepickerToggleChangeDateLabel, {
SELECTED_DATE: formattedDate,
}) || this.commonStrings.keys.datepickerToggle
);
return this.commonStrings.parse(this.commonStrings.keys.datepickerToggleChangeDateLabel, {
SELECTED_DATE: formattedDate,
});
}
return this.commonStrings.keys.datepickerToggleChooseDateLabel || this.commonStrings.keys.datepickerToggle;
return this.commonStrings.keys.datepickerToggleChooseDateLabel;
}

private listenForDateChanges() {
Expand Down
1 change: 0 additions & 1 deletion projects/angular/src/utils/i18n/common-strings.default.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ export const commonStringsDefault: ClrCommonStrings = {
alertCloseButtonAriaLabel: 'Close alert',
// Date Picker
datepickerDialogLabel: 'Choose date',
datepickerToggle: 'Toggle datepicker',
datepickerToggleChooseDateLabel: 'Choose date',
datepickerToggleChangeDateLabel: 'Change date, {SELECTED_DATE}',
datepickerPreviousMonth: 'Previous month',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,6 @@ export interface ClrCommonStrings {
* Datepicker UI labels
*/
datepickerDialogLabel: string;
datepickerToggle: string;
datepickerToggleChooseDateLabel: string;
datepickerToggleChangeDateLabel: string;
datepickerPreviousMonth: string;
Expand Down