DayPilot.Calendar.getCoords

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 pixels

  • y (number) - vertical position in pixels

  • time (DayPilot.Date) - exact date/time at the current position

  • column (DayPilot.Column) - current column

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:

LitePro
DayPilot for JavaScript