mx.controls
Class DateChooser



class DateChooser
extends mx.core.UIComponent

The DateChooser control displays the name of a month, the year, and a grid of the days of the month, with columns labeled for the day of the week. The user can select a date, a range of dates, or multiple dates. The control contains forward and back arrow buttons for changing the month and year. You can let users select multiple dates, disable the selection of certain dates, and limit the display to a range of dates.

MXML Syntax

The <mx:DateChooser> tag inherits all the properties of its parent classes, and the following properties:

 <mx:DateChooser
dayNames="["S", "M", "T", "W", "T", "F", "S"]"
disabledDays="No default."
disabledRanges="No default."
displayedMonth="Current month."
displayedYear="Current year."
firstDayOfWeek="0"
headerColor="#0FFFFFF"
headerStyleDeclaration="No default."
monthNames="["January", "February", "March", "April", "May",
"June", "July", "August", "September", "October", "November",
"December"]"
rollOverColor="#0xE3FFD6"
selectableRange="No default."
selectedDate="No default."
selectionColor="#0xCDFFC1"
showToday="true|false"
todayColor=""
todayStyleDeclaration="No default."
weekdayStyleDeclaration="No default."
change="Event handler; no default."
scroll="Event handler; no default."
/>

See Also
mx.controls.SimpleButton
mx.controls.CalendarLayout
mx.styles.StyleManager



Constructors
DateChooser ()
Constructor.


Methods

Methods inherited from class mx.core.UIComponent
getFocus  setFocus  getFocusManager 

Methods inherited from class mx.core.UIObject
createAccessibilityImplementation  measure  doLater  cancelAllDoLaters  invalidate  invalidateStyle  invalidateProperties  invalidateSize  redraw  move  setSize  setSizeNoLayout  drawRect  fillRect  destroyLabel  createClassObject  createEmptyObject  destroyObject  getStyle  setMask  swapDepths 


Properties
      className:String  
Name of this class.
staticversion:String  
ComponentVersion is for internal use only.
      todayStyleDeclaration:String  
Style sheet definition to configure the numeric date text of the control.
      headerStyleDeclaration:String  
Style sheet definition to configure the date in the header area of the control.
      weekDayStyleDeclaration:String  
Style sheet definition to configure the weekday names of the control.
      showToday:Boolean   [Read-Write]
If true, specifies that today is highlighted in the DateChooser control.
      firstDayOfWeek:Number   [Read-Write]
Day of the week (0-6, where 0 is the first element of the dayNames array) to display in the first column of the DateChooser control.
      displayedMonth:Number   [Read-Write]
Used with the displayedYear property, the displayedMonth property specifies the month displayed in the DateChooser control.
      displayedYear:Number   [Read-Write]
Used with the displayedMonth property, the displayedYear property determines which month is displayed in the DateChooser control.
      dayNames:Array   [Read-Write]
Weekday names for DateChooser control.
      disabledDays:Array   [Read-Write]
Days to disable in a week.
      selectableRange:Object   [Read-Write]
Range of dates between which dates are selectable.
      disabledRanges:Array   [Read-Write]
Disables single and multiple days.
      selectedDate:Date   [Read-Write]
Date selected in the DateChooser control.
      monthNames:Array   [Read-Write]
Names of the months displayed at the top of the DateChooser control.

Properties inherited from class mx.core.UIComponent
version  enabled  tabIndex 

Properties inherited from class mx.core.UIObject
version  nestLevel  dispatchEvent  addEventListener  handleEvent  removeEventListener  kStretch  styleName  className  setStyle  parentApplication  isDocument  parentDocument  documentDescriptor  descriptor  instanceIndices  repeaterIndices  getRepeaterItem  id  width  height  x  y  minHeight  minWidth  preferredHeight  preferredWidth  maxHeight  maxWidth  widthFlex  heightFlex  visible  scaleX  scaleY  alpha  depth  mouseX  mouseY  toolTip  baselinePosition 


Effects

Effects inherited from class mx.core.UIComponent
showEffect  hideEffect  focusInEffect  focusOutEffect 

Effects inherited from class mx.core.UIObject
creationCompleteEffect  moveEffect  resizeEffect  mouseDownEffect  mouseOverEffect  mouseOutEffect  mouseUpEffect 


Events
scrollHandler for scroll events, which are broadcast when the month changes due to user interaction. Target contains a reference to the component that triggered the event. Type contains the name of the event.
changeHandler for change events, which are broadcast when a date is selected. Target contains a reference to the component that triggered the event. Type contains the name of the event.

Events inherited from class: mx.core.UIComponent
focusIn  focusOut  keyDown  keyUp  show  hide  valid  invalid  valueCommitted 

Events inherited from class: mx.core.UIObject
initialize  creationComplete  resize  move  draw  load  unload  mouseDown  mouseUp  mouseMove  mouseOver  mouseOut  mouseDownSomewhere  mouseUpSomewhere  mouseMoveSomewhere  mouseChangeSomewhere  effectStart  effectEnd  dragBegin  dragComplete  dragEnter  dragOver  dragExit  dragDrop 


Styles
headerColor Type: Number   Format: Color   CSS Inheritance: yes
Color of the band at the top of the DateChooser control. The default value is #0FFFFFF
rollOverColor Type: Number   Format: Color   CSS Inheritance: yes
Color of the background when the user rolls over the link. The default value is #0xE3FFD6.
selectionColor Type: Number   Format: Color   CSS Inheritance: yes
Color of the background when the user selects the link. The default value is #0xCDFFC1.
todayColor Type: Number   Format: Color   CSS Inheritance: yes
Color of today`s date. The default value is #2B333C.

Styles inherited from class mx.core.UIComponent
backgroundColor  backgroundDisabledColor  backgroundImage  backgroundAlpha  backgroundSize  barColor  borderCapColor  borderColor  buttonColor  borderStyle  disabledColor  errorColor  highlightColor  lineHeight  modalTransparency  scrollTrackColor  shadowColor  shadowCapColor  symbolColor  symbolBackgroundColor  symbolBackgroundDisabledColor  symbolBackgroundPressedColor  symbolDisabledColor  themeColor 

Styles inherited from class mx.core.UIObject
color  fontFamily  fontSize  fontStyle  fontWeight  textAlign  textDecoration  textIndent  marginLeft  marginRight  horizontalGap  verticalGap 


Constructor Detail

DateChooser

DateChooser()

Constructor.


Property Detail

className

className:String  

Name of this class.


dayNames

dayNames:Array   [Read-Write]

Weekday names for DateChooser control. Changing this property changes the day labels of the DateChooser control. Sunday is the first day (at index 0). The rest of the week names follow in the normal order. The default is ["S", "M", "T", "W", "T","F", "S"].


disabledDays

disabledDays:Array   [Read-Write]

Days to disable in a week. All the dates in a month, for the specified day, are disabled. This property immediately changes the user interface of the DateChooser control. The elements of this array can have values from 0 (Sunday) to 6 (Saturday). For example, a value of "[0,6]" disables Sunday and Saturday.


disabledRanges

disabledRanges:Array   [Read-Write]

Disables single and multiple days. This property accepts an Array of objects as a parameter. Each object in this array is: a Date object, specifying a single day to disable; or an object containing either or both of the rangeStart and rangeEnd properties, each of whose values is a Date object. The value of these properties describes the boundaries of the date range. If either is omitted, the range is considered unbounded in that direction. If you specify only rangeStart, all the dates after the specified date are disabled, including the rangeStart date. If you specify only rangeEnd, all the dates before the specified date are disabled, including the rangeEnd date. To disable a single day, use a Date object specifying a date in the Array along with other objects. Setting this property immediately changes the appearance of the DateChooser control, if the disabled dates are included in the displayedMonth and displayedYear properties.


displayedMonth

displayedMonth:Number   [Read-Write]

Used with the displayedYear property, the displayedMonth property specifies the month displayed in the DateChooser control. Month numbers are zero-based, so January is 0 and December is 11. Setting this property immediately changes the appearance of the DateChooser control. The default value is the month number of today`s date.


displayedYear

displayedYear:Number   [Read-Write]

Used with the displayedMonth property, the displayedYear property determines which month is displayed in the DateChooser control. Setting this property immediately changes the appearance of the DateChooser control. The default value is today`s year.


firstDayOfWeek

firstDayOfWeek:Number   [Read-Write]

Day of the week (0-6, where 0 is the first element of the dayNames array) to display in the first column of the DateChooser control. Setting this property changes the order of the day columns. The default value is 0.


headerStyleDeclaration

headerStyleDeclaration:String  

Style sheet definition to configure the date in the header area of the control. If omitted, the header area inherits the text styles of the control.


monthNames

monthNames:Array   [Read-Write]

Names of the months displayed at the top of the DateChooser control. The default value is ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"].


selectableRange

selectableRange:Object   [Read-Write]

Range of dates between which dates are selectable. For example, a date between 04-12-2001 and 04-12-2003 is selectable, but dates out of this range are disabled. This property accepts an object as a parameter. This Object contains two Date objects, the rangeStart and rangeEnd properties. If you specify only rangeStart, all the dates after the specified date are enabled. If you only specify rangeEnd, all the dates before the specified date are enabled. to enable only a single day in a DateChooser control, you can pass a Date object can be directly.


selectedDate

selectedDate:Date   [Read-Write]

Date selected in the DateChooser control. Accepts a Date object as parameter.


showToday

showToday:Boolean   [Read-Write]

If true, specifies that today is highlighted in the DateChooser control. Setting this property immediately changes the appearance of the DateChooser control. The default value is true.


todayStyleDeclaration

todayStyleDeclaration:String  

Style sheet definition to configure the numeric date text of the control. If omitted, the date text field inherits the text styles of the control.


version

static version:String  

ComponentVersion is for internal use only.


weekDayStyleDeclaration

weekDayStyleDeclaration:String  

Style sheet definition to configure the weekday names of the control. If omitted, the weekday names inherit the text styles of the control.