Is there a way to get the moment the current page is displayed
For example, in the figure above, I want to get the date that the box is framed on
Is there a way to get the moment the current page is displayed
Hello,
There is no built-in way to get the viewport dates. But you can use the Gantt API for that.
To get the left position, you need to use the getScrollState
method:
https://docs.dhtmlx.com/gantt/api__gantt_getscrollstate.html
To get the right position, you need to add the width of the gantt.$task
element to the scroll position.
Then you need to convert the position to the date using the dateFromPos
method:
https://docs.dhtmlx.com/gantt/api__gantt_datefrompos.html
You can see how it works in the following snippet: