This release adds Angular 12 support
BREAKING CHANGES
- datepicker: The deprecated datepicker
@Input() showWeekdays: boolean
is removed fromNgbDatepicker
andNgbInputDatepicker
.
It was replaced by@Input() weekdays: TranslationWidth | boolean;
that also acceptsTranslationWidth
if necessary.
BEFORE:
<!-- datepicker -->
<ngb-datepicker [showWeekdays]="true"></ngb-datepicker>
<input ngbDatepicker [showWeekdays]="true"></input>
<!-- datepicker config -->
constructor(config: NgbDatepickerConfig) {
config.showWeekdays = true;
}
AFTER:
<!-- datepicker -->
<ngb-datepicker [weekdays]="true"></ngb-datepicker>
<input ngbDatepicker [weekdays]="true"></input>
<!-- datepicker config -->
constructor(config: NgbDatepickerConfig) {
config.weekdays = TranslationWidth.Short;
}
- datepicker: This change concerns you if you're creating custom datepicker calendars and i18ns.
The deprecated datepicker getWeekdayShortName(weekday: number): string;
is removed from NgbDatepickerI18n
.
It was replaced by getWeekdayLabel(weekday: number, width?: TranslationWidth): string;
to add TranslationWidth
option and align naming.
BEFORE:
@Injectable()
export class MyDatepickerI18n extends NgbDatepickerI18n {
getWeekdayShortName(weekday: number) { return 'your weekday short name'; }
}
AFTER:
@Injectable()
export class MyDatepickerI18n extends NgbDatepickerI18n {
getWeekdayLabel(weekday: number, width?: TranslationWidth) { return 'your weekday short name'; }
}