Search
DateChangedEventArgs.prevDate Property
See Also
 






Gets the previous visible date.

Namespace: MindFusion.Scheduling
File: EventArgs.js

 Syntax

JavaScript  Copy Code

get prevDate() {}

 Property Value

DateTime. The previous visible date.

 Remarks

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:

 Example

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