Re-initialize active_link

Hi,

How do I re-initialize active links after initializing scheduler?

Basically, I have created a settings page wherein users can select the date format they want. I can easily change the format by doing:

var chosenDateFormat;
if (optionChosen == 1) chosenDateFormat = '%D, %m/%j';
else if (optionChosen == 2) chosenDateFormat = '%j/%m/%Y';
else if (...) ...
else ...

scheduler.templates.timeline_scale_date = scheduler.date.date_to_str(chosenDateFormat);

The pseudo-code above successfully changes the date format of the template I chose to do it to. However, the links disappear.

I’ve tried this:

scheduler.templates.timeline_scale_date = function (date) {
        var d_s = scheduler.date.date_to_str(chosenDateFormat);
        return "<a jump_to='" + d_s(date) + "' href='#'>" + scheduler.date.date_to_str(chosenDateFormat) + "a</a>";
}

…but that returns with “function anonymous() { [native code] }”. Also, by simply setting the config.active_link_view = ‘day’, for example, does nothing prior to calling updateView.

Any help is greatly appreciated.

Thank you,
Jim

Hello,
in this line date_to_str add a function to your date template

return “” + scheduler.date.date_to_str(chosenDateFormat) + “a”;
docs.dhtmlx.com/scheduler/api__s … other.html
Also, the date in jump_to attribute must be in scheduler.config.api_date format
docs.dhtmlx.com/scheduler/api__s … onfig.html
Try following template

scheduler.templates.timeline_scale_date = function (date) { var d_s = scheduler.date.date_to_str(chosenDateFormat), api_date = scheduler.date.str_to_date(scheduler.config.api_date); return "<a jump_to='" + api_date(date) + "' href='#'>" + d_s(date) + "</a>"; }