Timeline switch

Hi,

In Month and Week view using the below code, the date is only showing the start date, and not the date range. See attached 2nd image, it does not have a date range? Do you know why this would be?

[code]

var sType = “Bar”;
var sUnit = “minute”;
var sDate = “%H:%i”;
var iStep = 30;
var iSize = 24;
var iStart = 16;
var iLength = 48;

    if (bCell){
        sType = "cell";
    }

switch (sView){
case “Hour”:
sUnit = “minute”;
sDate = “%H:%i”; // Hour and Day.
iStep = 30;
iSize = 30;
iStart = 16;
iLength = 48;
break;
case “Day”:
sUnit = “hour”;
sDate = “%H:%i”; // Hour and Day.
iStep = 1;
iSize = 24;
iStart = 1;
iLength = iSize;
break;
case “Week”:
sUnit = “day”;
sDate = “%D %M %d”;
iStep = 1;
iSize = 7;
iStart = 0;
iLength = iSize;
break;
case “Month”:
sUnit = “week”;
sDate = “%D %M %d”;
iStep = 1;
iSize = 4;
iStart = 0;
iLength = iSize;
break;
case “Year”:
sUnit = “month”;
sDate = “%M %Y”;
iStep = 1;
iSize = 12; // How many months
iStart = 0;
iLength = iSize;
break;
case “Default”:
break;
}

    scheduler.createTimelineView({
		name:	"timeline",
		x_unit:	sUnit,
		x_date:	sDate,
		x_step:	iStep,
		x_size: iSize,
		x_start: iStart,
		x_length:	iLength,
		y_unit:	sections,
		y_property:	"section_id",
		render:sType
	});[/code]

Many thanks.




If you are using scheduler 2.3 - issue must not occur.
In code, the template looks as

scheduler.templates[obj.name+"_date"] = function(datea, dateb){ if (datea.getDay()==dateb.getDay() && datea-dateb<(24*60*60*1000)) return scheduler.templates.day_date(datea); return scheduler.templates.week_date(datea, dateb); };

So the single date rendering will be triggered only if start date and end date are the same day.
You may to force the necessary behavior by adding code like next , after createTimeline call

scheduler.templates.timeline_date = function(datea, dateb){ return scheduler.templates.week_date(datea, dateb); };

Thank you very much Stanislav. Have a great day.