We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Hide weekends in datepicker

Hi,

I want to block/hide the weekends in calendar which is opened when clicked on datepicker icon at the start field


1 Reply

SK Satheesh Kumar Balasubramanian Syncfusion Team November 14, 2022 10:53 AM UTC

You can use isDisabled property in the renderDayCell event of the DateTimePicker to disable the calendar weekends.

app.component.ts:

  public onPopupOpen(args: PopupOpenEventArgs) {

    if (args.type === 'Editor') {

      let dialog = (args.element as any).ej2_instances[0];

      dialog.open = (e) => {

        let startTimeObj =

          e.element.querySelector('#StartTime').ej2_instances[0];

        startTimeObj.renderDayCell = (args) => {

          /*Date need to be disabled*/

          if (args.date.getDay() === 0 || args.date.getDay() === 6) {

            args.isDisabled = true;

          }

        };

      };

    }

  }


Loader.
Live Chat Icon For mobile
Up arrow icon