API Documentation | All Packages | All Classes | Index | Frames No Frames |
Class DPCPTimeChooser

Package | ca.dpcp.components
Class | public class DPCPTimeChooser
Inheritance | DPCPTimeChooser mx.containers.Canvas

The DPCPTimeChooser component (or control) provides a simple way to let the user select a time-of-day.

It supports both 12- and 24-hour modes, and is localizable (i.e. translatable into languages other than English).

To localize, see the accompanying DPCPTimeChooser.properties file.

For further info, examples, and updates, visit dpcp.ca/flex.

NOTE: DPCPTimeChooser is not free. You may use it for an evaluation period of 30 days from the time of first download, but after that you must purchase a license to continue using it. Please visit dpcp.ca/flex for further information.

Public Properties

| Property | Defined by
--- | --- | ---
|  | bTimeSelected : Boolean Indicates whether a time has been selected (true), or not (false). | DPCPTimeChooser

Public Methods

| Method | Defined by
--- | --- | ---
|  | DPCPTimeChooser(i12or24:uint = 0) | DPCPTimeChooser
|  | getHours():int | DPCPTimeChooser
|  | getLocaleTimeStringFromTimeString(s:String, i12or24:uint = 0):String [static] Returns a time string formatted the same way as (non-static) getTimeLocaleString(), according to locale settings in .properties file. | DPCPTimeChooser
|  | getMinutes():int | DPCPTimeChooser
|  | getTimeLocaleString():String | DPCPTimeChooser
|  | getTimeString():String | DPCPTimeChooser
|  | setTimeFromString(s:String):void Sets the component's time. | DPCPTimeChooser

Public Constants

| Constant | Defined by
--- | --- | ---
|  | TIME_CHANGED : String = "DPCPTimeChooser_TimeChanged" [static] For use in Event-handling, i.e. | DPCPTimeChooser
|  | _version : String = "1.1.0, 2008-01-31 10:05" [static] Version of the DPCPTimeChooser component | DPCPTimeChooser

Property detail

bTimeSelected | property

`bTimeSelected:Boolean` [read-write]

Indicates whether a time has been selected (true), or not (false).

Used to reset time selected to 'none' (by setting to false).

Behaviour is undefined if set to 'true' when no time value is actually set.

Implementation
`public function get bTimeSelected():Boolean`
`public function set bTimeSelected(value:Boolean):void`
Constructor detail

DPCPTimeChooser | () | constructor

`public function DPCPTimeChooser(i12or24:uint = 0)`

Parameters

| `i12or24:uint` (default = `0`)`` — Defaults to 12- or 24-hour per locale setting (in the .properties file). To override, pass in 12 for 12-hour or 24 for 24-hour.

Method detail

getHours | () | method

`public function getHours():int`

Returns

| `int` — The value of the component's hours (0 to 23). If no time is selected, returns -1.

getLocaleTimeStringFromTimeString | () | method |

`public static function getLocaleTimeStringFromTimeString(s:String, i12or24:uint = 0):String`

Returns a time string formatted the same way as (non-static) getTimeLocaleString(), according to locale settings in .properties file.

Parameters

| `s:String` — Time string in format HH:MM (or HH:MM:SS, in which case the SS is dropped). If s is not in format HH:MM, behaviour is undefined.
| `i12or24:uint` (default = `0`)`` — Defaults to 12- or 24-hour per locale setting (in the .properties file). To override, pass in 12 for 12-hour or 24 for 24-hour.

Returns

| `String`

getMinutes | () | method |

`public function getMinutes():int`

Returns

| `int` — The value of the component's minutes (0 to 59). If no time is selected, returns -1.

getTimeLocaleString | () | method |

`public function getTimeLocaleString():String`

Returns

| `String` — The value of the component's time according to locale settings in .properties file (with 12- or 24-hour mode possibly depending on how component was constructed, if overridden)

getTimeString | () | method |

`public function getTimeString():String`

Returns

| `String` — The value of the component's time in format HH:MM

setTimeFromString | () | method |

`public function setTimeFromString(s:String):void`

Sets the component's time.

Parameters

| `s:String` — The time to set to, in format HH:MM (or HH:MM:SS, in which case the SS is ignored). If s is not in format HH:MM, behaviour is undefined.

Constant detail

TIME_CHANGED | constant

`public static const TIME_CHANGED:String = "DPCPTimeChooser_TimeChanged"`

For use in Event-handling, i.e. listening for a change in the time by the user.

For example:

`addEventListener( DPCPTimeChooser.TIME_CHANGED, handlerFunction );`

_version | constant |

`public static const _version:String = "1.1.0, 2008-01-31 10:05"`

Version of the DPCPTimeChooser component