The getDate() method of the JavaScript Scheduler converts a pixel position to a date.
You can get the current pixel position relative to the Scheduler grid using getCoords().
Declaration
DayPilot.Scheduler.getDate(pixels [, precise[, isEnd]])Parameters
pixels(number) - horizontal pixel position relative to the Scheduler gridprecise(boolean) - determines whether the exact time position (true) or the start of the current cell (false) is returnedisEnd(boolean) - determines how a border position between two cells is treated: fortrue, it uses the previous cell; forfalse, it uses the next cell for the time calculation (applicable only when the timeline is not continuous)
Return Value
Returns DayPilot.Date.
Example
const dp = new DayPilot.Scheduler("dp", {
// ...
});
dp.init();
const date = dp.getDate(100);See Also
DayPilot.Scheduler.getCoords()
Timeline [doc.daypilot.org]
Availability
Availability of this API item in DayPilot editions:
| Product | Lite | Pro |
|---|---|---|
| DayPilot for JavaScript |
DayPilot