Search
DateTimeView Class
See Also
 






A base class for calendar views.

Namespace: MindFusion.Common.UI
File: DateTimeView.js

 Syntax

JavaScript  Copy Code

// class
DateTimeView.prototype = {}

 Example

The following code creates a Calendar and handles its viewChanged event to check if the view is changed to DayView:

JavaScript  Copy Code

var ui = MindFusion.UI;

var calendar = new ui.Calendar(document.querySelector("#cal"));
calendar.theme = "gray";
calendar.viewChanged.addEventListener(handleViewChanged);
calendar.render();

function handleViewChanged(sender, args)
{
    var dayView = new ui.DayView();

    //if the view has been changed to DayView
    if ( typeof args.newItem == typeof dayView )
    {
        //do something
    } 
}

 Inheritance Hierarchy

MindFusion.Common.UI.UIControl
    MindFusion.Common.UI.DateTimeView
        MindFusion.Common.UI.DayView
        MindFusion.Common.UI.DecadeView
        MindFusion.Common.UI.MonthView
        MindFusion.Common.UI.YearView

 See Also