Hi
I am using a timeline component. I want to implement a feature to scroll the view to the start of the next event that is not visible, taking in account the events currently shown.
I know that I can get the date that correspons to the left position of the viewport, using this code
const currentView = this.scheduler.getCurrentView();
new Date(currentView.dateFromPos(currentView.getScrollPosition().left));
Is it possible get the date that corresponds to the right position of the viewport? With this value I can calculate the start date of the next event and scroll to this date.
Unfortunately there is no built-in function for that, but technically it can be done using JS and scheduler API.
The idea could be to create a cycle, and check out events for each date of the view, if there are events, you can check out if there are existing as HTML elements with the getRenderedEvent(scheduler renders some events in close range outside of viewport).
If there are visible you can check if there are actually displayed in the viewport with the JS, here is example of code that can check it: