2

When loading the calendar, I have divided the hours into intervals of 30 mins each.

This is my initial configuration.

    scheduler.locale.labels.unit_tab = "Resources";
    scheduler.config.hour_date = "%h:%i %A";
    scheduler.config.hour_size_px = 88;
    scheduler.config.mark_now = true;
    scheduler.locale.labels.section_custom = "Assigned to";
    scheduler.config.separate_short_events = true;
    scheduler.config.drag_move = false;
    scheduler.config.drag_resize = false;

Due to the 30 mins, my calendar has a scroll bar. The default calendar shows only about 6.5 hrs. So if the current time is 3 PM, the mark_now line is off the view. How do I set focus to the current time and have the current time or mark_now be in the horizontal center of the display?

I am learning dhtmlx and may not be able to answer all queries so would appreciate any guidance. Thanks in advance!

sbjumani
  • 124
  • 8

1 Answers1

2

You can add something like next

scheduler.config.scroll_hour = (new Date).getHours();

It will configure scheduler to scroll day or week view to the current hour.

Aquatic
  • 5,084
  • 3
  • 24
  • 28
  • 1
    Nope, this does not seem to be working. Here is the code snippet I have: json = JSON.parse(result); scheduler.parse(json.events, "json"); scheduler.config.mark_now = true; scheduler.config.scroll_hour = (new Date).getHours(); scheduler.init('scheduler_here', new Date(), "unit"); scheduler.updateView(); – sbjumani Jul 17 '14 at 03:38