Hide/Disable Timeslot

Hello,

How can I deactivate a few hours in the timeline? For example:
I just want to show the hours between 8:00 AM and 11:00 AM and between 4:00 PM and 7:00 PM.
(Hours from 00:00 to 08:00 and from 11:00 to 16:00 and from 19:00 to 23:59 should be hidden)

Thanks for your help!



1 Reply 1 reply marked as answer

HB Hareesh Balasubramanian Syncfusion Team August 5, 2020 03:46 PM UTC

Dear Customer, 

Greetings from Syncfusion Support.!!! 

We have validated your share query (Hours from 00:00 to 08:00 and from 11:00 to 16:00 and from 19:00 to 23:59 should be hidden) at our end. And we suspect that your requirement is to hide/disable the selected timeslots. And we are not able to hide those timeslots but we can able to disable it. And for that, we have prepared a sample using actionBegin and popupOpen Scheduler events and the sample can be viewed from the following link. 

Code snippet: 
  actionBegin: function (args) { 
    if (args.requestType == "eventCreate" || args.requestType == "eventChange") { 
      var data = ej.base.isNullOrUndefined(args.data[0]) ? args.data.StartTime : args.data[0].StartTime; 
      if ((data.getHours() >= 0 && data.getHours() <= 7) || (data.getHours() >= 11 && data.getHours() <= 15) || (data.getHours() >= 19 && data.getHours() <= 23)) { 
        args.cancel = true; 
      } 
    } 
  }, 
  popupOpen: function (args) { 
    var data = ej.base.isNullOrUndefined(args.data.startTime) ? args.data.StartTime : args.data.startTime; 
    if ((data.getHours() >= 0 && data.getHours() <= 7) || (data.getHours() >= 11 && data.getHours() <= 15) || (data.getHours() >= 19 && data.getHours() <= 23)) { 
      args.cancel = true; 
    } 
  } 


Kindly try the above solution and get back to us if you need any further assistance. 

Regards, 
Hareesh 


Marked as answer
Loader.
Up arrow icon