Blocking Dates

Hello,
I used the method below to block my calendar:

              scheduler.blockTime({
                        days: [01,2,3,4,5,6],
                        zones: [07 * 60, 31 * 60],
                        type: "dhx_time_block",
                        css: "gray_section"
                    });

However, for some menus work, and others not.
Worked for menus “Day”, “Week”, “People”, perfectly blocking the calendar, as the image below:


But the menus “Month”, “Table”, “Grid” remain open for scheduling, as the image below:


How can I do to also block scheduling in these menus?
Thanks a lot.

Hi,
The method “blockTime” is deprecated. We strongly encourage you to use the addMarkedTimespan method instead:
docs.dhtmlx.com/scheduler/api__s … espan.html
In the month view blocked periods are not highlighted, if you try to save a new event, or drag an event to blocked period - the “onLimitViolation” will fire, and changes will not be saved.
docs.dhtmlx.com/scheduler/api__s … event.html

I am seeing the same issue. i switched to use the addMarkedTime api but on the month view my date is still not marked or blocked. I’m trying to set July 4th 2014 as a holiday and block it. The addMarkedTimespan marks and blocks July 4th 2014 in the week view, but not in Month. I have a css for holdiay_week and holiday_month. The function i included below is called on the scheduler’s onBeforeViewChange event.

//Javascript
function handleModeChange(old_mode, old_date, new_mode, new_date) {

		var holidayDate = new Date("2014, July, 04");
		
		if (old_mode === "month" && new_mode !== "month") {
			calendarInstance.addMarkedTimespan({
				days:	holidayDate,
				zones:"fullday",
				css:	"holiday_week",
				type:	"dhx_time_block"
			});
			calendarInstance.updateView(new_date, new_mode);
		}
		else if (old_mode !== "month" && new_mode === "month"){
			calendarInstance.addMarkedTimespan({
				days:	holidayDate,
				zones:	"fullday",
				css:	"holiday_month",
				type:	"dhx_time_block"
			});
			calendarInstance.updateView(new_date, new_mode);
		}

		return true;
	}

//css
.holiday_month .dhx_month_body {
background-color: #C39EE8;
opacity:0.5;
filter:alpha(opacity=50);
}

.holiday_month .dhx_month_head {
background-color: #C39EE8;
opacity:0.5;
filter:alpha(opacity=50);
}

.holiday_week {
background-image:url(…/js/vendor/dhtmlx/scheduler/imgs/holidaybg.png) !important;
}

Hi,
in the month view the marked timespans are not highlighted via CSS. You can use templates to set a different color for this cell:
docs.dhtmlx.com/scheduler/api__s … plate.html

The month view is marked by CSS even when using the template.moth_date_class (specifies the CSS class that will be applied to a day cell), but that wasn’t my original issue. My issue is how do i Block users from being able to schedule in the month view without using type: “dhx_time_block” in the blockTime or AddMarkedTimespan api?

Hello,

Thanks for helping guys.
Really month was not being locked when I limited schedules as below:
zones: [07 * 60, 31 * 60]

I solved the problem by adding Fullday for the parameter “zones”.
Now this also locked in the month, however, was unable to assign the color “gray_section”. Remains blank, but already better, because I can not limit to a schedule to be done in a blocked date.

In the code below I am blocking every day of the week regardless of the date:

            var result = '';
            $.ajax({
                type: 'GET',
                //url: '/GetDiasBloq.aspx', // localhost
                url: '/Adm/GetDiasBloq.aspx', // AR
                processData: true,
                data: {},
                dataType: "json; charset=utf-8",
                responseType: "",
                success: function (data, textStatus, jqXHR) {

                    result = data;

                    scheduler.blockTime({
                        days: [result[77], result[12], result[22], result[33], result[44], result[54], result[65]],
                        zones: ["fullday"],
                        type: "dhx_time_block",
                        css: "gray_section"
                    });

                }
            });