:: Home >>

setDataFormat

Configures parsing for the datasource date strings.

Possible values - ISO8601, RFC822 or default.

Syntax

date.setDataFormat(name);

Parameters

name (string) - incoming format (ISO8601, RFC822 or default)

Examples

ISO8601

var myData = [
    ["ActiveWidgets 1.0", "2004-05-18T00:00:00+01:00"]
];

var date = new AW.Formats.Date;
date.setDataFormat("ISO8601"); // ISO8601 input

RFC822

var myData = [
    ["ActiveWidgets 2.0", "Mon, 12 Jun 2006 12:34:56 +0100"]
];

var date = new AW.Formats.Date;
date.setDataFormat("RFC822"); // RFC822 input

default

var myData = [
    ["ActiveWidgets 2.x", "12/25/2006"]
];

var date = new AW.Formats.Date;

Remarks

ISO8601

Dates in ISO8601 format -

2006-01-23                        // date only
2006-01-23 12:34                  // date time
2006-01-23 12:34Z                 // UTC
2006-01-23 12:34:56               // seconds
2006-01-23 12:34:56.789           // milliseconds
2006-01-23 12:34:56.789+01        // timezones
2006-01-23 12:34:56.789+0100      //
2006-01-23T12:34:56.789+01:00     // T time separator
2006-11-30T12:01:02.0000000+00:00 // .NET date

RFC822

Dates in RFC822 date format -

Sat, 19 Aug 2006 10:56:05 -0400

default

Any valid format for javascript Date.parse() method (without timezone).

12/25/2006
Dec 25, 2006
December 25, 2006
25 Dec 2006
25 December 2006
Dec 25, 2006 12:34

See also

setTextFormat, setCellFormat methods

Comments

8 Jul 08
Format as date or empty Roland (1)
29 Aug 06
date formatting Patrick (1)
27 Jul 06
Unix Timestamp... any suggestions how to handle it? Yereth (2)

Comments will appear on this page and in the main forum.

Documentation:

Recent changes:

2.6.4
2.6.3
2.6.2
2.6.1
2.6.1
2.6.0
2.5.0 - 2.5.6
2.5.6
2.5.0 - 2.5.5
2.5.5