DayPilot.Scheduler.getDate

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 grid

  • precise (boolean) - determines whether the exact time position (true) or the start of the current cell (false) is returned

  • isEnd (boolean) - determines how a border position between two cells is treated: for true, it uses the previous cell; for false, 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]

DayPilot.Scheduler Class

Availability

Availability of this API item in DayPilot editions:

LitePro
DayPilot for JavaScript