The getCoords() method returns information about the current mouse cursor position relative to the Calendar grid.
Available since 2023.3.5726.
DayPilot.Calendar.getCoords()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.
const calendar = new DayPilot.Calendar("dp", {
// ... config
});
calendar.init();
const coords = calendar.getCoords();