Provides a selection from a range of dates.
Available since
1.0.0
.Variables
selectedDate:Date
The currently selected date. Returns null
if no date is selected.
When the value of the selectedDate
property changes, the component
will dispatch an event of type Event.CHANGE
.
The following example selects a specific date:
control.selectedDate = Date.now();
The following example clears the currently selected date:
control.selectedDate = null;
The following example listens for when the selection of a calendar component changes, and it requests the new selected index:
var calendar = new CalendarGrid();
function changeHandler(event:Event):Void
{
var calendar = cast(event.currentTarget, CalendarGrid);
trace("selection change: " + calendar.selectedDate);
}
calendar.addEventListener(Event.CHANGE, changeHandler);
Available since
1.0.0
.See also:
openfl.events.Event.CHANGE