Block out dates for Month view of schedule

Good day,

We have a schedule control that can display appointments in day, week, month and agenda view. When a resource is outside work time, we use blockoutSettings property by giving the intervals that are outside work time and it successfully gray out the unavailable hours in day and week view. However, in month view, days inside blocked interval are not grayed out. I have noticed that in UWP documentation, there is property MonthBlockOutDates that maybe does exactly that, however it's missing from asp.net mvc or javascript documentation. Have I missed something to make it work or it's not yet implemented in our platform?

Thank you.

1 Reply

KK Karthigeyan Krishnamurthi Syncfusion Team October 24, 2018 09:37 AM UTC

 
Thank you for contacting Syncfusion support. 
 
In month view, block out range will be displayed only if the IsAllDay filed is set to true. We have prepared the below sample to display the block out range to the whole day in month view alone and on time basis on other views. 
 
.BlockoutSettings(fields => fields.Enable(true) 
              .TemplateId("#blocktemplate") 
              .Datasource(ViewBag.BlockDatasource) 
                .Id("BlockId") 
                .Subject("BlockSubject") 
                .StartTime("BlockStartTime") 
                .EndTime("BlockEndTime") 
                .IsBlockAppointment("BlockIsBlockAppointment") 
                .IsAllDay("BlockFullDay") 
          ) 
 
.ScheduleClientSideEvents(evts => evts.ActionComplete("BlockAppointment").Create("BlockAppointment")) 
 
function BlockAppointment(args) { 
        if (args.type == "create" || args.requestType == "viewNavigate" || args.requestType == "dateNavigate" || args.requestType == "dataBound") { 
            var schObj = $("#Schedule1").data("ejSchedule"); 
            var data = $.extend(true, [], schObj.model.blockoutSettings.dataSource); 
            if (args.model.currentView == "month") { 
                for (var i = 0; i < data.length; i++) { 
                    data[i].BlockFullDay = true; 
                } 
            } else { 
                for (var i = 0; i < data.length; i++) { 
                    data[i].BlockFullDay = false; 
                } 
            } 
            schObj.option("blockoutSettings.dataSource", data); 
        } 
    } 
 
Regards, 
Karthigeyan 


Loader.
Up arrow icon