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

Moving 2 day calendar

Asked by Andre Belpanno
7 years ago.

I made a separate page in my project that just displays the daypilot scheduler. On this page I have it set to display 2 days but it displays the start of day 1 at 12am until the end of day 2 at 11pm. How do I get it to display the start time on day 1 to the current time and the end time to be 48hrs from that time (2days)? I don't want to display any past events on this board.

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

You need to use Scale="Manual" and generate the timeline manually:
https://doc.daypilot.org/scheduler/timeline/

Something like this:
private void CreateTimeline()
{
  DayPilotScheduler1.Scale = TimeScale.Manual;
  DayPilotScheduler1.Timeline.Clear();

  // start now
  DateTime first = DateTime.Today.AddHours(DateTime.Now.Hour);

  // add one cell per hour
  for (int i = 0; i < 48; i++)
  {
      DateTime start = first.AddHours(i);
      DateTime end = start.AddHours(1);
      DayPilotScheduler1.Timeline.Add(start, end);
  }
}
Comment posted by Andre Belpanno
7 years ago.

That worked perfect!

This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.