{ "type": "class", | |
"qname": "mx.formatters.DateFormatter", | |
"baseClassname": "mx.formatters.Formatter" | |
, | |
"description": "The DateFormatter class uses a format String to return a formatted date and time String from an input String or a Date object. You can create many variations easily, including international formats. <p>If an error occurs, an empty String is returned and a String describing the error is saved to the <code>error</code> property. The <code>error</code> property can have one of the following values:</p> <ul> <li><code>"Invalid value"</code> means a value that is not a Date object or a is not a recognized String representation of a date is passed to the <code>format()</code> method. (An empty argument is allowed.)</li> <li> <code>"Invalid format"</code> means either the <code>formatString</code> property is set to empty (""), or there is less than one pattern letter in the <code>formatString</code> property.</li> </ul> <p>The <code>parseDateString()</code> method uses the mx.formatters.DateBase class to define the localized string information required to convert a date that is formatted as a String into a Date object.</p> <p>You use the <code><mx:DateFormatter></code> tag to render date and time Strings from a Date object.</p> <p>The <code><mx:DateFormatter></code> tag inherits all of the tag attributes of its superclass, and adds the following tag attributes:</p> <pre>\\n <mx:DateFormatter\\n formatString="Y|M|D|A|E|H|J|K|L|N|S|Q|O|Z"\\n />\\n </pre>", | |
"tags": [ | |
{ "tagName": "includeExample", | |
"values": ["examples/DateFormatterExample.mxml"]}, | |
{ "tagName": "see", | |
"values": ["mx.formatters.DateBase"]}, | |
{ "tagName": "mxml", | |
"values": []}, | |
{ "tagName": "playerversion", | |
"values": ["Flash 9", "AIR 1.1"]}, | |
{ "tagName": "productversion", | |
"values": ["Royale 0.9.3"]}, | |
{ "tagName": "langversion", | |
"values": ["3.0"]} ], | |
"members": [ | |
{ "type": "method", | |
"qname": "parseDateString", | |
"namespace": "public", | |
"bindable": [], | |
"details": ["static"], | |
"deprecated": {}, | |
"description": "Converts a date that is formatted as a String into a Date object. Month and day names must match the names in mx.formatters.DateBase. The hour value in the String must be between 0 and 23, inclusive. The minutes and seconds value must be between 0 and 59, inclusive. The following example uses this method to create a Date object: <pre>\\n var myDate:Date = DateFormatter.parseDateString("2009-12-02 23:45:30"); </pre> The optional format property is use to work out which is likly to be encountered first a month or a date of the month for date where it may not be obvious which comes first.", | |
"tags": [ | |
{ "tagName": "see", | |
"values": ["mx.formatters.DateBase"]}, | |
{ "tagName": "param", | |
"values": ["str Date that is formatted as a String."]}, | |
{ "tagName": "playerversion", | |
"values": ["Flash 9", "AIR 1.1"]}, | |
{ "tagName": "productversion", | |
"values": ["Royale 0.9.3"]}, | |
{ "tagName": "return", | |
"values": ["Date object."]}, | |
{ "tagName": "langversion", | |
"values": ["3.0"]} ], | |
"return": "Date", | |
"params": [{ "name": "str", "type": "String"}, | |
{ "name": "format", "type": "String"}]} | |
, | |
{ "type": "method", | |
"qname": "mx.formatters.DateFormatter", | |
"namespace": "", | |
"bindable": [], | |
"details": [], | |
"deprecated": {}, | |
"description": "Constructor.", | |
"tags": [ | |
{ "tagName": "param", | |
"values": ["formatString Date format pattern is set to this DateFormatter."]}, | |
{ "tagName": "playerversion", | |
"values": ["Flash 9", "AIR 1.1"]}, | |
{ "tagName": "productversion", | |
"values": ["Royale 0.9.3"]}, | |
{ "tagName": "langversion", | |
"values": ["3.0"]} ], | |
"return": "", | |
"params": [{ "name": "formatString", "type": "String"}]} | |
, | |
{ "type": "accessor", | |
"access": "read-write", | |
"return": "String", | |
"qname": "formatString", | |
"namespace": "public", | |
"bindable": [], | |
"details": [], | |
"deprecated": {}, | |
"description": "The mask pattern. <p>You compose a pattern String using specific uppercase letters, for example: YYYY/MM.</p> <p>The DateFormatter pattern String can contain other text in addition to pattern letters. To form a valid pattern String, you only need one pattern letter.</p> <p>The following table describes the valid pattern letters:</p> <table class="innertable"> <tr><th>Pattern letter</th><th>Description</th></tr> <tr> <td>Y</td> <td> Year. If the number of pattern letters is two, the year is truncated to two digits; otherwise, it appears as four digits. The year can be zero-padded, as the third example shows in the following set of examples: <ul> <li>YY = 05</li> <li>YYYY = 2005</li> <li>YYYYY = 02005</li> </ul></td> </tr> <tr> <td>M</td> <td> Month in year. The format depends on the following criteria: <ul> <li>If the number of pattern letters is one, the format is interpreted as numeric in one or two digits. </li> <li>If the number of pattern letters is two, the format is interpreted as numeric in two digits.</li> <li>If the number of pattern letters is three, the format is interpreted as short text.</li> <li>If the number of pattern letters is four, the format is interpreted as full text. </li> </ul> Examples: <ul> <li>M = 7</li> <li>MM= 07</li> <li>MMM=Jul</li> <li>MMMM= July</li> </ul></td> </tr> <tr> <td>D</td> <td>Day in month. While a single-letter pattern string for day is valid, you typically use a two-letter pattern string. <p>Examples:</p> <ul> <li>D=4</li> <li>DD=04</li> <li>DD=10</li> </ul></td> </tr> <tr> <td>E</td> <td>Day in week. The format depends on the following criteria: <ul> <li>If the number of pattern letters is one, the format is interpreted as numeric in one or two digits.</li> <li>If the number of pattern letters is two, the format is interpreted as numeric in two digits.</li> <li>If the number of pattern letters is three, the format is interpreted as short text. </li> <li>If the number of pattern letters is four, the format is interpreted as full text. </li> </ul> Examples: <ul> <li>E = 1</li> <li>EE = 01</li> <li>EEE = Mon</li> <li>EEEE = Monday</li> </ul></td> </tr> <tr> <td>A</td> <td> am/pm indicator.</td> </tr> <tr> <td>J</td> <td>Hour in day (0-23).</td> </tr> <tr> <td>H</td> <td>Hour in day (1-24).</td> </tr> <tr> <td>K</td> <td>Hour in am/pm (0-11).</td> </tr> <tr> <td>L</td> <td>Hour in am/pm (1-12).</td> </tr> <tr> <td>N</td> <td>Minute in hour. <p>Examples:</p> <ul> <li>N = 3</li> <li>NN = 03</li> </ul></td> </tr> <tr> <td>S</td> <td>Second in minute. <p>Example:</p> <ul> <li>SS = 30</li> </ul></td> </tr> <tr> <td>Q</td> <td>Millisecond in second <p>Example:</p> <ul> <li>QQ = 78</li> <li>QQQ = 078</li> </ul></td> </tr> <tr> <td>O</td> <td>Timezone offset <p>Example:</p> <ul> <li>O = +7</li> <li>OO = -08</li> <li>OOO = +4:30</li> <li>OOOO = -08:30</li> </ul></td> </tr> <tr> <td>Z</td> <td>Timezone name <p>Example:</p> <ul> <li>Z = GMT</li> </ul></td> </tr> <tr> <td>Other text</td> <td>You can add other text into the pattern string to further format the string. You can use punctuation, numbers, and all lowercase letters. You should avoid uppercase letters because they may be interpreted as pattern letters. <p>Example:</p> <ul> <li>EEEE, MMM. D, YYYY at L:NN:QQQ A = Tuesday, Sept. 8, 2005 at 1:26:012 PM</li> </ul></td> </tr> </table>", | |
"tags": [ | |
{ "tagName": "default", | |
"values": [""MM/DD/YYYY""]}, | |
{ "tagName": "playerversion", | |
"values": ["Flash 9", "AIR 1.1"]}, | |
{ "tagName": "productversion", | |
"values": ["Royale 0.9.3"]}, | |
{ "tagName": "langversion", | |
"values": ["3.0"]} ]}, | |
{ "type": "method", | |
"qname": "format", | |
"namespace": "public", | |
"bindable": [], | |
"details": ["override"], | |
"deprecated": {}, | |
"description": "Generates a date-formatted String from either a date-formatted String or a Date object. The <code>formatString</code> property determines the format of the output String. If <code>value</code> cannot be formatted, return an empty String and write a description of the error to the <code>error</code> property. or a date-formatted String such as "Thursday, April 22, 2004". of the error condition is written to the <code>error</code> property.", | |
"tags": [ | |
{ "tagName": "param", | |
"values": ["value Date to format. This can be a Date object,"]}, | |
{ "tagName": "playerversion", | |
"values": ["Flash 9", "AIR 1.1"]}, | |
{ "tagName": "productversion", | |
"values": ["Royale 0.9.3"]}, | |
{ "tagName": "return", | |
"values": ["Formatted String. Empty if an error occurs. A description"]}, | |
{ "tagName": "langversion", | |
"values": ["3.0"]} ], | |
"return": "String", | |
"params": [{ "name": "value", "type": "Object"}]} | |
] | |
} |