Skip to main content

setCurrentView

Description

Displays the specified view and date

setCurrentView: (date?: Date, view?: string) => void

Parameters

  • date - (optional) Date - the date to display
  • view - (optional) string - the name of a view to display

Example

// displays the current view and date. Doesn't change anything, just refreshes
scheduler.setCurrentView();
// displays 2027-08-04 in the currently active view
scheduler.setCurrentView(new Date(2027, 7, 4));
// displays 2027-06-03 in the Week view
scheduler.setCurrentView(new Date(2027, 5, 3), "week");

Details

  • The names for default views are 'day', 'week', 'month'. To specify any other view, use its name parameter.
  • The method invokes onBeforeViewChange and onViewChange.
  • The method is similar to updateView(). The only difference is that updateView() doesn't generate any events.
Need help?
Got a question about the documentation? Reach out to our technical support team for help and guidance. For custom component solutions, visit the Services page.