addMarkedTimeSpans GUI Issue

Hello all, im working on an Asp.Net MVC application using the dhtmlxScheduler library.
I have gotten all the logic working, but there appears to be an area on the GUI where the blocked time shouldn’t be. (Picture below for reference)

Here are my configs:

        scheduler.createTimelineView({
            name: "timeline",
            x_unit: "minute",
            x_step: 30,
            x_start: 16,
            x_date: "%H:%i",
            x_size: 24,
            x_length: 48,
            y_unit: engineers,
            event_dy: 'full',
            y_property: "engineer_id",
            render: "bar"
        });

        @try
        {
            foreach (var item in Model.EngineerSchedule)
            {
                var key = item.Key;
                var eng_id = item.Value;

                var weekValue = Model.WeeklySchedule.Where(k => k.Key == key).Select(v => v.Value).Cast<List<string>>();
                string hello = "hello";

        
                @: gatherTimes('@Html.Raw(Json.Encode(key))', '@Html.Raw(Json.Encode(weekValue))', '@Html.Raw(Json.Encode(eng_id))');
            }
        }

         catch (Exception e) { }


        function gatherTimes(weekKey, values, engs)
        {
            values = values.slice(2, values.length - 2);
        
            var week = values;
            week = week.split(",");

            var eng_ids = engs.replace('[', '');
            eng_ids = eng_ids.replace(']', '');
            eng_ids = eng_ids.split(',');
        
            timeRestrictions(week, eng_ids, weekKey);
        }

        function timeRestrictions(week, ids, key) 
        {
            //array to hold the float values for the times. 
            var floatArray = [];

            for(var i = 0; i < week.length; i++)
            {
                var num = week[i].replace('"', '');
                num = num.replace('"', '');

                floatArray[floatArray.length] = Number(num);
            }


            scheduler.addMarkedTimespan({
                days: [1,2,3,4,5],
                zones: [floatArray[0] * 60, floatArray[1] * 60],invert_zones: true,
                type:  "dhx_time_block",
                css: "red_section",
                html: "<div style='text-align: center; height: 44px;'> <b style='color=black; '> Blocked Hours </b> </div>",
                engineers: { timeline: ids}
            });
        }


Hi,
can you attach a resulting js code that is rendered by your .cshtml or a static js that is enough to reproduce the problem locally?
Right now I don’t have the ‘Model.EngineerSchedule’ data that is used in your code, so i can’t reproduce the problem

Thank you for the reply, posted below is the actual values that are being passed to the function gatherTimes(weekKey, weekValues, engs) The database key, a string array with times, and a string array containing the associated engineer IDs for the week.

gatherTimes('"2"', '[["8","17","8","17","8","17","8","17","8","17","N/A","N/A","N/A","N/A"]]', '["20602"]');

gatherTimes('"1"', '[["8","17","8","17","8","17","8","17","8","17","N/A","N/A","N/A","N/A"]]', '["10201","20525","31113","20505","10301","31114","31108","31115","20801","10101","10410","10302","20618","20526","20609","20604","20615","31109","20507","20705","10202","10203","10413","20712","20501","20614","20704","20607","10204","31103","990002","990003","990004","31111","10404","10408","10315","10316","10317","10318","10319","10415","10416","10417","10418","10419","20702","20504","31116","20703","20522","10205","20516","20719","20605","10206","10411","20718","20608","10412","20511","31106","20515","20716","10207","10303","10406","10102","20802","20803","10103","20513","20520","31102","20708","31101","20714","20804","10104","20521","20606","10304","10105","20805","10208","10407","20611","20709","20619","10305","20617","10209","20713","10414","20806","10106","10402","20706","20502","20601","10306","20509","20518","10307","10308","20508","31105","20717","31110","31104","20807","10107","20720","10309","20701","31107","20517","10108","20808","20809","10109","10401","10403","20506","20612","20715","20711","10409","20710","10310","10311","10405","31112","20514","20620","10312","20613","20503","20523","20616","10210","20610","10313","10110","20810","20524","20603","20512","10314","20707","20510","20519","990001","20811"]');

These same values get formatted in the gatherTimes function before sending them to the timeRestrictions function.

I suspect that my formatting is incorrect in the gatherTimes function which is the reason for the issue with the GUI on the scheduler.

Thanks for your time!

Hi,
I’ve reproduced a bug, scheduler tries to display a part of marked timespan which is not displayed in the timeline scale (00:00 - 08:00) but defined in your marked timespan configuration.

We’ll prepare a fix by the next update, currently you can minimize the visible effect by adding this style to the page:

.dhx_marked_timespan { overflow:hidden; }