Search
DateChangedEventArgs.newDate Property
See Also
 






Gets the new visible date.

Namespace: MindFusion.Scheduling
File: EventArgs.js

 Syntax

JavaScript  Copy Code

get newDate() {}

 Property Value

DateTime. The new visible date.

 Example

The following code handles the visibleDateChanged event with a method that loads JSON data for the calendar from an url. The method loads the url based on the newly loaded month:

JavaScript  Copy Code

// handle the visibleDatechanged event to load the corresponding data when the calendar month is changed
calendar.visibleDateChanged.addEventListener(getData);

function getData(sender, args)
{
 var url = 'http://calapi.inadiutorium.cz/api/v0/en/calendars/default/' + calendar.date.year + '/' + args.newDate.month;

 fetch(url)
 .then(response => response.json())
 .then((data) => {
  loadCalendar(data)
 })
 .catch(err => { throw err });
}

 See Also