The getCoords() method returns information about the current mouse cursor position relative to the Calendar grid.
Available since 2023.3.5726.
Declaration
DayPilot.Calendar.getCoords()Return Value
Returns an object with the following properties:
x(number) - horizontal position in pixelsy(number) - vertical position in pixelstime(DayPilot.Date) - exact date/time at the current positioncolumn(DayPilot.Column) - current columnalt(boolean) - Alt key pressed status (since 2026.2.6912)ctrl(boolean) - Ctrl key pressed status (since 2026.2.6912)shift(boolean) - Shift key pressed status (since 2026.2.6912)meta(boolean) - Meta key pressed status (since 2026.2.6912)
Returns null if the current position cannot be read, for example when the mouse cursor is outside of the grid.
Example
const calendar = new DayPilot.Calendar("dp", {
// ... config
});
calendar.init();
const coords = calendar.getCoords();See Also
Availability
Availability of this API item in DayPilot editions:
| Product | Lite | Pro |
|---|---|---|
| DayPilot for JavaScript |
DayPilot