style current (today) column in timeline view

Hi,
can someone tell me how to style column in timeline view, which containing current day (timeline can have day, week or other unit as x_unit - I’m looking for the idea to style current column).

or maybe is there a way to style all past columns? Sorry for my english lv. and thanx for advices

You can style each cell of timeline through template
docs.dhtmlx.com/scheduler/api__s … plate.html

even if on this page, is an information: “The Timeline view, ‘tree’ mode only” ?
ok, i will try… thanx for advice :slight_smile:

another question: scheduler doesnt add the class like “current” to current x_unit by default?

using function, that You reminded, i need to search every cell and check if it’s this which i’m looking for?

The documentation is a bit misleading, it will work for any timeline ( we will update documentation )

As for current date, it requires just a few lines of code

scheduler.templates.timeline_cell_class = function(evs, date, section){ if (date.getDate() == (new Date()).getDate()) return "current"; };

thanx, but when i try to do that like in your example, class “current_week” will be added to every week of every month, wchich can contain current day number, class “past_week” will be only added to first cell. Dunno why :>

how work this function, is it called on every sub-table, containing every section timeline?
if is, maybe i’m wrong, but function should attach “past_week” class to every week till week will be current one… ?

sorry, but i cant take how it works alone, need help :frowning:

is it called on every sub-table, containing every section timeline?
It is called for each cell in the timeline ( each day, each unit )

Try to use

[code]//convert date to a number
var daysnum = function(date){
return date.getFullYear()*450+date.getMonth()*350+date.getDate();
}
//number of today
var today = daysnum(new Date());

//styling
scheduler.templates.timeline_cell_class = function(evs, date, section){
if (daysnum(date) == today)
return “current”;
else if (daysnum(date) < today )
return “past”;
return “”;
};[/code]

hmm. i found, that including extension called “scheduler_limit” will add a red dotted line to timeline view. anyway, for now its what i needed.

if I understand, i can in another way style past columns, by adding martedTimespan, am i right?

Yes, you can use martedTimespan functionality to style any period of time ( that can be used to style all past dates as well )