Setting timeline start date and duration dynamically

On my form I have start and end date fields from which the user can pick a date range. I have a function called GetTimelineDays which returns the duration in days.

How can I apply the new start date and duration to the timeline?

I have this which doesn’t work …

var x = GetTimelineDays(); scheduler.matrix.timeline.x_size = x; scheduler.update_view();

Hello,

var x = GetTimelineDays();

What value do you have here now? Be sure to check that it is valid and number (not string).

scheduler.matrix.timeline.x_size = x; scheduler.update_view();
Should work correctly, though better use scheduler.setCurrentView();

Kind regards,
Ilya

Hi.

It is a number being returned and it works now uset setCurrentView()

:sunglasses: