Hi!
Im working on a timeline view that shows 21 days on the x-axis, covering the previous week, current week and next week. I have set round_position to true and I’d like every event to be presented by a bar covering the particular date. I noticed that if the end time is before 18:00, the bar doesn’t round up to the full day but shows as a tiny bar on the left side of the cell. I’d like to ask for advice as to how to fix this.
I have noticed that if I comment out the function I define for scheduler.date.timeline_start to start the timeline view at previous week’s monday, the events are all rounded up correctly.
Below is my scheduler configs, createTimelineView() and the scheduler.date.timeline_start function. Suggestions? Am I defining timeline_start correctly, or doing something really stupid?
scheduler.locale.labels.timeline_tab = "Aikajana";
scheduler.locale.labels.section_inspector="Tarkastaja";
scheduler.locale.labels.section_state="Tila";
scheduler.config.first_hour = 8;
scheduler.config.last_hour = 20;
scheduler.config.details_on_create=true;
scheduler.config.details_on_dblclick=true;
scheduler.xy.bar_height = 60;
scheduler.config.xml_date="%Y-%m-%d %H:%i";
scheduler.config.default_date = "%D, %j %F";
scheduler.config.day_date = "%D, %j %F";
scheduler.createTimelineView({
name: "timeline",
x_unit: "day", // unit which should be used for second scale
x_date: "%D %d.%m", // date format which should be used for second scale, "July 01"
x_size: 21,
x_start: 0,
x_length: 21,
y_unit: sections,
y_property: "userIdForEvent",
render:"bar",
round_position:true,
section_autoheight: false
});
scheduler.date.timeline_start = function(date) {
if (date.toDateString() == (new Date().toDateString())) {
var distanceFromLastWeekMonday = date.getDay() + 6;
date.setTime( date.getTime() - distanceFromLastWeekMonday * 86400000 );
}
return date;
}