igniteui-angular icon indicating copy to clipboard operation
igniteui-angular copied to clipboard

Blocking the navigation from moving to the future month and years.

Open Shikhajaiswal123 opened this issue 7 years ago • 2 comments

Description

Can you please block the future years and months of calendar used in igx-calendar component.

  • igniteui-angular version: 6.1.1
  • browser: Chrome

Steps to reproduce

1.Go to https://drgdnmjoqen.angular.stackblitz.io 2.Click right arrow for navigating the future years.

In the igx-calender only the current month and year should be enabled/displayed and all the future year and months on selection should be blocked or disabled.

Result

we can see that in igx-calendar display the future years and months when navigated.

Expected result

In the igx-calender only the current month and year should be enabled/displayed and all the future year and months on selection should be blocked or disabled.

Attachments

Shikhajaiswal123 avatar Jan 21 '19 12:01 Shikhajaiswal123

For now, the navigation cannot be prevented, but you can mark of the dates past a particular date as disabled, and end-users wouldn't be able to select a date from that time period.

  public disabledDates: DateRangeDescriptor[] = [
    { type: DateRangeType.After, dateRange: [new Date()]}
  ];

  @ViewChild("picker")
  public picker: IgxCalendarComponent;

  ngOnInit() {
    this.picker.disabledDates = this.disabledDates;
  }

Btw, the disabledDates were implemented after 6.1.1 (introduced in 6.2.0), so you would have to ng update in order to use them.

kdinev avatar Jan 21 '19 14:01 kdinev

@Shikhajaiswal123 hi i'm closing this issue reopen if you need more clarification

SlavUI avatar Feb 18 '19 13:02 SlavUI