Main Page | Packages | Class Tree | Index | Help

xp.data

class DateFormatter

Object
  |
  +--xp.data.DateFormatter


class DateFormatter
extends Object

DateFormatter
Formats date for data binding In many cases dates are held as strings in raw data ina custom format to handle this DateFormatter uses two date format string, one to convert the display string to a Date object and a second to convert a Date object into raw data


Author:
ProWin Computers Ltd. - Rob Edgar

Version:
3.0.0.000

See also:


Constructor

public
DateFormatter ( displayFormat: String, dataFormat: String, datatype: String)
Constructor DateFormatter uses two date format string

Method Summary

public
format ( value: Object, data: Object ): Object
Converts from a raw data type to a new object

public
parse ( value: Object, data: Object ): Object
Converts from a string, or other data type, to the raw data type



Constructor Documentation

DateFormatter

public function DateFormatter(displayFormat: String,
 dataFormat: String,
 datatype: String)
Constructor DateFormatter uses two date format string

Parameters:
displayFormat
format string to format and parse a Date object for display
dataFormat
format string to format and parse a Date object into raw data
datatype
type of raw data required. [Optional] defaults to Date unless a dataFormat is specified in which case it will default to string values can be "s" string, "d" date, "n" number

Method Documentation

format

public function format(value: Object,
 data: Object): Object
Converts from a raw data type to a new object

Converts from a raw data type to a new object.

Usage:
This method is called automatically; you don’t invoke it directly.

Parameters:
value
The raw data value to be formatted
data
If being used for DataBinding this will be the row data otherwise it will be null
Returns:
A formatted value

parse

public function parse(value: Object,
 data: Object): Object
Converts from a string, or other data type, to the raw data type

Converts from a string, or other data type, to the raw data type. This transformation should be the exact inverse transformation of IDataFormatter.format().

Usage:
This method is called automatically; you don’t invoke it directly.

Parameters:
value
The formatted value
data
If being used for DataBinding this will be the row data otherwise it will be null
Returns:
An unformatted value


The documentation was generated from the following file:


Generated on 10/30/2005 9:34:02 PM by AS2Doc