Packageardisia.scheduling.datePicker
Classpublic class DatePicker
InheritanceDatePicker Inheritance spark.components.supportClasses.SkinnableComponent
Implements mx.managers.IFocusManagerComponent

The DatePicker component is a datepicker that conforms in appearance and functionality more closely to those of desktop calendar clients than the default Flex DateChooser.

It also allows for more robust customization, particularity in regards to its appearance due to skinning and custom item renderers.

View the technical documentation on the Ardisia Labs website for more information.



Public Properties
 PropertyDefined By
  displayedMonth : Date
Stores and sets the month that is currently displayed.
DatePicker
  firstDayOfWeek : int
Defines what day is the 1st day of the week.
DatePicker
  highlightedDateRange : Period
The beginning and end dates for a date range that should be highlighted or displayed differently.
DatePicker
  selectedDate : Date
The currently selected date.
DatePicker
Protected Properties
 PropertyDefined By
  displayedMonthDirty : Boolean
private
DatePicker
  firstDayOfWeekDirty : Boolean
private
DatePicker
  selectedDateDirty : Boolean
private
DatePicker
Public Methods
 MethodDefined By
  
DatePicker
Protected Methods
 MethodDefined By
  
dayNumbersRendererPartHandler(event:MouseEvent):void
Handles mousedown events on the dayNumbersPart and updates the selected date.
DatePicker
  
displayedMonthToString(formatDate:Date):String
Returns the text for the monthLabel skin part.
DatePicker
  
keyDownHandler(event:KeyboardEvent):void
[override] Handles keyboard interaction when the DatePicker component has focus.
DatePicker
  
nextMonthButtonPartHandler(event:Event):void
Handles clicks on the nextMonthButtonPart skin part.
DatePicker
  
Handles clicks on the previousMonthButtonPart skin part.
DatePicker
  
retrieveIndex(event:MouseEvent):int
Retrieve the index moused.
DatePicker
  
Updates the day names skin part.
DatePicker
  
Updates the day numbers skin part.
DatePicker
  
Updates the month label skin part.
DatePicker
Events
 Event Summary Defined By
  Dispatched when the currently displayed month changes.DatePicker
  Dispatched when the selected date changes.DatePicker
Styles
 Style Description Defined By
  
borderAlpha
Type: Number CSS Inheritance: no
The alpha of the border. The default value is 1.
DatePicker
  
borderColor
Type: uint Format: Color CSS Inheritance: no
The color of the border. The default value is see theme defaults.css.
DatePicker
  
borderVisible
Type: Boolean CSS Inheritance: no
True to display a border. The default value is true.
DatePicker
Skin Parts

This component uses skins made up of skin parts. Do not set the skin parts directly. The component's skin sets the skin parts.


 Skin Part Description Defined By
  
datePickerDayNameRendererFactoryPart:mx.core.IFactory
Required: true Part Type: Dynamic
Factory that creates the renderers that displays the day names.

The IFactory must return an object of type IDayNamesRenderer
DatePicker
  
datePickerDayNumberRendererFactoryPart:mx.core.IFactory
Required: true Part Type: Dynamic
Factory that creates the renderers that displays the day numbers.

The IFactory must return an object of type IDayNumbersRenderer
DatePicker
  
dayNamesRendererPart:spark.components.Group
Required: true Part Type: Static
Wrapper for the renderers that will display the names of the days of the week. The host component will handle the renderer creation and data, while this skin part will handle layout.
DatePicker
  
dayNumbersRendererPart:spark.components.Group
Required: true Part Type: Static
Wrapper for the renderers that will display the numbers of the days of the displayed date range. The host component will handle the renderer creation and data, while this skin part will handle layout.
DatePicker
  
monthLabelPart:spark.components.Label
Required: false Part Type: Static
Label for what month is currently displayed.
DatePicker
  
nextMonthButtonPart:spark.components.Button
Required: false Part Type: Static
Button to move the displayed month forwards one month.
DatePicker
  
previousMonthButtonPart:spark.components.Button
Required: false Part Type: Static
Button to move the displayed month backwards one month.
DatePicker
Property Detail
displayedMonthproperty
displayedMonth:Date

Stores and sets the month that is currently displayed. Set with a Date object that defines the month you want to display. E.G. for September, September 1 and September 21 Date objects would both register the displayedMonth as September.

This property is bindable and is bound to the "monthChange" event.

The default value is Month based on today's date.

This property can be used as the source for data binding.


Implementation
    public function get displayedMonth():Date
    public function set displayedMonth(value:Date):void
displayedMonthDirtyproperty 
protected var displayedMonthDirty:Boolean

private

firstDayOfWeekproperty 
firstDayOfWeek:int

Defines what day is the 1st day of the week.

0 = Sunday... 6 = Saturday

This property is bindable.

The default value is 1 (Monday).

This property can be used as the source for data binding.


Implementation
    public function get firstDayOfWeek():int
    public function set firstDayOfWeek(value:int):void
firstDayOfWeekDirtyproperty 
protected var firstDayOfWeekDirty:Boolean

private

highlightedDateRangeproperty 
highlightedDateRange:Period

The beginning and end dates for a date range that should be highlighted or displayed differently.

Useful to style dates differently when they are displayed in an calendar or selected in a different component.

The default value is null.


Implementation
    public function get highlightedDateRange():Period
    public function set highlightedDateRange(value:Period):void
selectedDateproperty 
selectedDate:Date

The currently selected date. Times are scrubbed so only month, year, and day information is available.

This property is bindable and is bound to the "selectedDateChange" event.

The default value is null.

This property can be used as the source for data binding.


Implementation
    public function get selectedDate():Date
    public function set selectedDate(value:Date):void
selectedDateDirtyproperty 
protected var selectedDateDirty:Boolean

private

Constructor Detail
DatePicker()Constructor
public function DatePicker()



Method Detail
dayNumbersRendererPartHandler()method
protected function dayNumbersRendererPartHandler(event:MouseEvent):void

Handles mousedown events on the dayNumbersPart and updates the selected date.

Parameters

event:MouseEvent — the Event object that triggered the handler

displayedMonthToString()method 
protected function displayedMonthToString(formatDate:Date):String

Returns the text for the monthLabel skin part. Override this function to customize the text.

The default is the DateFormatter format MMMM YYYY.

Parameters

formatDate:Date — The Date object representing the currently displayed month.

Returns
String — String
keyDownHandler()method 
override protected function keyDownHandler(event:KeyboardEvent):void

Handles keyboard interaction when the DatePicker component has focus. Users can move the selected date via the arrow keys.

Parameters

event:KeyboardEvent — the KeyboardEvent object that triggered the handler

nextMonthButtonPartHandler()method 
protected function nextMonthButtonPartHandler(event:Event):void

Handles clicks on the nextMonthButtonPart skin part. Advances the currently displayed month forward 1 month.

Parameters

event:Event — the Event object that triggered the handler

previousMonthButtonPartHandler()method 
protected function previousMonthButtonPartHandler(event:Event):void

Handles clicks on the previousMonthButtonPart skin part. Advances the currently displayed month back 1 month.

Parameters

event:Event — the Event object that triggered the handler

retrieveIndex()method 
protected function retrieveIndex(event:MouseEvent):int

Retrieve the index moused.

Parameters

event:MouseEvent — the MouseEvent that triggered the handler

Returns
int — the clicked index (int)
updateDayNamesRendererPart()method 
protected function updateDayNamesRendererPart():void

Updates the day names skin part.

updateDayNumbersRendererPart()method 
protected function updateDayNumbersRendererPart():void

Updates the day numbers skin part.

updateMonthLabelPart()method 
protected function updateMonthLabelPart():void

Updates the month label skin part.

Event Detail
monthChange Event
Event Object Type: ardisia.scheduling.datePicker.events.DatePickerEvent
DatePickerEvent.type property = ardisia.scheduling.datePicker.events.DatePickerEvent

Dispatched when the currently displayed month changes.

selectedDateChange Event  
Event Object Type: ardisia.scheduling.datePicker.events.DatePickerEvent
DatePickerEvent.type property = ardisia.scheduling.datePicker.events.DatePickerEvent

Dispatched when the selected date changes.