Skip to content

Commit

Permalink
fix(kit): CalendarRange shows actual defaultViewedMonth
Browse files Browse the repository at this point in the history
  • Loading branch information
mdlufy committed Oct 5, 2024
1 parent 20b1c61 commit e2c639a
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
EventEmitter,
Inject,
Input,
OnChanges,
OnInit,
Optional,
Output,
Expand Down Expand Up @@ -37,7 +38,7 @@ import {takeUntil} from 'rxjs/operators';
changeDetection: ChangeDetectionStrategy.OnPush,
providers: [TuiDestroyService],
})
export class TuiPrimitiveCalendarRangeComponent implements OnInit {
export class TuiPrimitiveCalendarRangeComponent implements OnInit, OnChanges {
@Input()
disabledItemHandler: TuiBooleanHandler<TuiDay> = ALWAYS_FALSE_HANDLER;

Expand Down Expand Up @@ -99,6 +100,10 @@ export class TuiPrimitiveCalendarRangeComponent implements OnInit {
monthOffset: TuiTypedMapper<[TuiMonth, number], TuiMonth> = (value, offset) =>
value.append({month: offset});

ngOnChanges(): void {
this.setInitialMonths();
}

ngOnInit(): void {
this.setInitialMonths();
}
Expand Down

0 comments on commit e2c639a

Please sign in to comment.