search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

Scroll to particular hour of day

Asked by Nirav Upadhyay
7 years ago.

I am using group by hour and displays a single day in my scheduler.
I have a requirement of when DayPilot loads, it should scroll to 9am time instead of displaying always 12am.
I can do it with scrollTo method and set the pixels to scroll on load, but is there any way to scroll jump directly to specific hour of a day?

Answer posted by Dan Letecky [DayPilot]
7 years ago.

The scrollTo() method also accepts DayPilot.Date object/ISO 8601 date string so you can use it to scroll to a specific point in time.

The Angular 2 version also supports scrollTo as a property of the config:

import {Component} from '@angular/core';
import {DayPilot} from "daypilot-pro-angular";

@Component({
  selector: 'angular2-scheduler-example',
  template: `<daypilot-scheduler [config]="config"></daypilot-scheduler`
})
export class AppComponent {

  config: any = {
    // ...
    scrollTo: DayPilot.Date.today()
  }

}

It's broken in the latest official release (8.3.2573) but it's working again in the latest sandbox build (since 8.3.2575).

The following scrolling-related config properties are also supported:

  • scrollX (position in pixels)
  • scrollY (position in pixels)
  • scrollToAnimated (scrollTo animation type: null | speedInSteps | "slow" | "normal" | "fast" | "linear")
  • scrollToPosition (scrollTo target position: "left" | "middle" | "right")
This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.