DayPilot.Scheduler.scrollTo(date | pixels[, animated[, position]]);
Sets the horizontal scrollbar position to the target date.
When infinite scrolling is enabled, the Scheduler will shift the timeline automatically if the target date isn't in the current timeline.
Parameters
- date (string in ISO 8601 format, DayPilot.Date object) - target date/time
- pixels (number) - target position in pixels
- animated ("fast" | "normal" | "slow" | "linear") - scrolling animation; null means no scrolling, "linear" adjusts the speed depending on distance
- position ("left", "middle", "right") - target position of date within the viewport (default is "left")
Examples
Scroll to current time.
dp.scrollTo(DayPilot.Date.now());
Scroll to January 1, 2023:
dp.scrollTo("2023-01-01");
Demo