DHTMLX Cookies and Timeline Extensions Conflict

I’m trying to use both extensions so that whenever the page is reloaded it stays on the same day.
However every time I use it with timeline it gives me this error:

dhtmlxscheduler.js:162 Uncaught TypeError: Cannot read property ‘valueOf’ of undefined
at Object.scheduler.is_visible_events (dhtmlxscheduler.js:162)
at Object.scheduler.event_updated (dhtmlxscheduler.js:162)
at Object.scheduler.addEvent (dhtmlxscheduler.js:159)
at Object.e.addEvent (dhtmlxscheduler_recurring.js:24)
at Object.scheduler._process_loading (dhtmlxscheduler.js:200)
at Object.scheduler.on_load (dhtmlxscheduler.js:200)
at Object.scheduler.parse (dhtmlxscheduler.js:203)
at Object.success (scheduler.php:170)
at i (jquery-2.2.3.min:2)
at Object.fireWith [as resolveWith] (jquery-2.2.3.min:2)

FOLLOWED by a bunch of these

dhtmlxscheduler_timeline.js:57 Uncaught TypeError: Cannot read property ‘length’ of undefined
at Object.e._timeline_drag_date (localhost/abstract/FrontEnd/js/d … e.js:57:94)
at Object.e.(anonymous function) [as mouse_timeline] (localhost/abstract/FrontEnd/js/d … .js:15:121)
at Object.scheduler._mouse_coords (localhost/abstract/FrontEnd/js/d … .js:84:412)
at Object.scheduler.getActionData (localhost/abstract/FrontEnd/js/d … js:122:331)
at Object. (localhost/abstract/FrontEnd/js/d … .js:80:136)
at Object.z [as ev_onmousemove] (localhost/abstract/FrontEnd/js/d … .js:39:496)
at Object.obj.callEvent (localhost/abstract/FrontEnd/js/d … .js:39:277)
at Object.scheduler._on_mouse_move (localhost/abstract/FrontEnd/js/d … r.js:97:55)
at HTMLDivElement._obj.onmousemove (localhost/abstract/FrontEnd/js/d … .js:74:120)

Any thoughts?

Hi,

Could you please create a sample demo where the problem can be reproduced? It should help us understand the cause of it.

Or at least show us timeline configurations.

Sure no problem,

I get all info through an ajax call and the configs are these:

var data =  JSON.parse(response);
				var eventsArray = data['eventsArray'];
				var yArray = data['y_unit'];
				var shiftTypesArray = data['shiftTypeOptions'];
				var schedStops = data['schedStops'];
				var elements = Array();
				var shiftTypes = Array();
				
				for(var i in yArray){
					elements.push({ 
						key: yArray[i]['key'],
						label: yArray[i]['label'] 
								});
				}				
				
				for(var j in shiftTypesArray){
					shiftTypes.push({ 
						key: shiftTypesArray[j]['key'],
						label: shiftTypesArray[j]['label'] 
								});
				}
				
				scheduler.locale.labels.timeline_tab  = "Diário";
				scheduler.locale.labels.timeline_tab2 = "Semanal";
				scheduler.config.multisection = true;

				scheduler.config.xml_date="%Y-%m-%d %H:%i";
				scheduler.config.prevent_cache = true;
				
				scheduler.config.repeat_date ="%d-%m-%Y";
				scheduler.config.wide_form = true;
				scheduler.config.details_on_create=true;
				scheduler.config.details_on_dblclick=true;
				scheduler.config.buttons_left=["dhx_save_btn","dhx_cancel_btn","swap_button"];
				scheduler.locale.labels["swap_button"] = "Paragem Planeada";
				scheduler.config.include_end_by = true;
				scheduler.config.start_on_monday = false;
				scheduler.config.time_step = 15;
				
				var lightbox_PP = [
					{name:"Paragem Planeada",map_to:"text", type:"select", options: schedStops},
					{name:"Alterar Série", map_to:"isChecked", type:"checkbox", checked_value: 1,unchecked_value: 0},	
					{name:"recurring", type:"recurring", map_to:"rec_type", button:"recurring"},				
					{name:"time", type:"time", map_to:"auto"}
				];				
				
				var lightbox_turno = [
					{name:"Turno", map_to:"text", type:"select", options: shiftTypes},
					{name:"Alterar Série", map_to:"isChecked", type:"checkbox", checked_value: 1,unchecked_value: 0},	
					{name:"recurring", type:"recurring", map_to:"rec_type", button:"recurring"},
					{name:"time", type:"time", map_to:"auto"}
				];
				
				scheduler.config.lightbox.sections = lightbox_turno;
				
				scheduler.createTimelineView({
					 name:"timeline",
					 x_unit:"minute",//measuring unit of the X-Axis.
					 x_date:"%H:%i", //date format of the X-Axis
					 x_step:120,//sets the '30 minute' step, e.g. 09:00 - 09:30
					 x_size:12,// the number of '30 minute's in a 9 hour interval
							   // 9 hours = 540 minutes = 540/30 = 18
					 x_lenght:12,//scrolls a day:1 day= 24 hours= 1440 minutes= 1440/30= 48 'x_step's
					 second_scale:{
						x_unit: "day", // the measuring unit of the axis (by default, 'minute')
						x_date: "%D %d" //the date format of the axis ("July 01")
					 },
					 y_unit: elements,
					 y_property:"linhaID", //mapped data property
					 section_autoheight : false,
					 dy: 50,
					 render:"bar"            //view mode
				});
				
				scheduler.createTimelineView({
					 name:"timeline2",
					 x_unit:"hour",//measuring unit of the X-Axis.
					 x_date:"%H:%i", //date format of the X-Axis
					 x_step:8,//sets the '30 minute' step, e.g. 09:00 - 09:30
					 x_size:21,// the number of '30 minute's in a 9 hour interval
							   // 9 hours = 540 minutes = 540/30 = 18
					 x_lenght:2,//scrolls a day:1 day= 24 hours= 1440 minutes= 1440/30= 48 'x_step's
					 second_scale:{
						x_unit: "day", // the measuring unit of the axis (by default, 'minute')
						x_date: "%F %D %d" //the date format of the axis ("July 01")
					 },
					 y_unit: elements,
					 y_property:"linhaID", //mapped data property
					 render:"bar"            //view mode
				});

				scheduler.init('scheduler_here',new Date(),"timeline");
				scheduler.parse(eventsArray,"json");

We tried to reproduce, but seems the issue is connected with data you load.
docs.dhtmlx.com/scheduler/snippet/99936023

Could you reproduce the problem in snippet?
Or provide with access to your application, where the error occurs?

Sorry, I found a solution afterwars. I ended up storing in the DB the last event and type of view and loading it everytime the scheduler starts