search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

Manual timeline starting from hour, minute etc misaligns with cells

Asked by Viktor Eriksson
4 years ago.

When setting scale to manual and building my own timeline starting from a time value instead of pure date value it seems like the cells where the events are rendered are misaligned with the time header. If the timeheader starts around 6 in the morning a sunday it seems like the cells start rendering 00:00 sunday.

Anything I'm doing wrong or bug ?

Answer posted by Dan Letecky [DayPilot]
4 years ago.

The time headers follow the "groupBy" specification. If you use groupBy: "Day" the time headers cells with start at 00:00 and end at 24:00 (00:00 the next day). In this case, it doesn't depend on the grid cells.

If you want the headers to match the grid cells you need to use groupBy: "Cell".

See also:
https://doc.daypilot.org/scheduler/time-header-groups/

Let me know if it doesn't help.

Comment posted by Viktor Eriksson
4 years ago.

I dont really understand what you mean.
I have a fiddle here, maybe you can show here:
http://jsfiddle.net/js29bcu0/

Comment posted by Dan Letecky [DayPilot]
4 years ago.

See the timeHeaders definition on line 10:

dps.timeHeaders = [{ groupBy: "Year"  }, { groupBy: "Month"  }, { groupBy: "Week"  }, { groupBy: "Cell" , format: "d" }];

Updated fiddle:
http://jsfiddle.net/g3c05pv2/

Comment posted by Viktor Eriksson
4 years ago.

If I add another level to the timeheaders:
dps.timeHeaders = [{ groupBy: "Year" }, { groupBy: "Month" }, { groupBy: "Week" }, { groupBy: "Day" , format: "d" }, { groupBy: "Cell" , format: "tt" }];

and set cellDuration to 1440 then yes, the lowest timeheader and grid-cells align. But then the timeheader cell row misaligns with the other timeheader rows.

Comment posted by Viktor Eriksson
4 years ago.

I tried the link you posted, but then the cell-row misaligns with the rest of the headers.

Comment posted by Dan Letecky [DayPilot]
4 years ago.

It can either align with the official calendar (groupBy values of "Day", "Week", etc.) or with the custom time cells. There is no way to change the week start to a specific hour of day (in the headers).

I find this kind of cell arrangement a bit confusing. The cell start doesn't really mean anything.

I would recommend a different approach: Make the first timeline cell partial (starting at current time and ending at midnight) and use "width" property to make it proportionally narrower, then continue with standard days starting and ending at midnight. The last cell can also be partial, starting at midnight and ending at the current time.

This way it will be obvious that the Scheduler displays just a part of the first and last day while the other cells will be standard.

This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.