Skip to content

10.0.0

Compare
Choose a tag to compare
@maxokorokov maxokorokov released this 01 Jul 14:00
· 505 commits to master since this release

This release adds Angular 12 support

BREAKING CHANGES

  • datepicker: The deprecated datepicker @Input() showWeekdays: boolean is removed from NgbDatepicker and NgbInputDatepicker.
    It was replaced by @Input() weekdays: TranslationWidth | boolean; that also accepts TranslationWidth 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'; }
}