The getViewport() method returns information about the current JavaScript Scheduler viewport.
Before version 2025.2.6458, this method was called getViewPort().
Declaration
DayPilot.Scheduler.getViewport()Return Value
Returns an object with the following properties:
start(DayPilot.Date) - start of the viewport as date/time;nullif the timeline is emptyend(DayPilot.Date) - end of the viewport as date/time;nullif the timeline is emptyresources(array of strings) - resource IDstopLeft- object with information about the cell in the top-left corner (see below; since 2019.2.3880)bottomRight- object with information about the cell in the bottom-right corner (see below; since 2019.2.3880)
Cell object:
start(DayPilot.Date) - start of the cell as date/timeend(DayPilot.Date) - end of the cell as date/timeresource(string) - resource IDx(number) - horizontal position of the cell in the gridy(number) - vertical position of the cell in the grid
See Also
Scrollbar Position [doc.daypilot.org]
Availability
Availability of this API item in DayPilot editions:
| Product | Lite | Pro |
|---|---|---|
| DayPilot for JavaScript |
DayPilot