Zimlet JavaScript API Reference - AjxDateFormat

Class AjxDateFormat




Defined in: AjxText.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
AjxDateFormat(pattern)
The AjxDateFormat class formats Date objects according to a specified pattern.
Field Summary
Field Attributes Field Name and Description
<static>  
AjxDateFormat.DEFAULT
Default date/time format style.
<static>  
AjxDateFormat.FULL
Full date/time format style.
<static>  
AjxDateFormat.LONG
Long date/time format style.
<static>  
AjxDateFormat.MEDIUM
Medium date/time format style.
<static>  
AjxDateFormat.NUMBER
Number date .
<static>  
AjxDateFormat.SHORT
Short date/time format style.
Method Summary
Method Attributes Method Name and Description
<static>  
AjxDateFormat.format(pattern, date)
Format a date.
<static>  
AjxDateFormat.getDateInstance(style)
Get a date formatter.
<static>  
AjxDateFormat.getDateTimeInstance(dateStyle, timeStyle)
Get a date and time formatter.
<static>  
AjxDateFormat.getTimeInstance(style)
Get a time formatter.
 
parse(s)
Parses the given string and returns a date.
<static>  
AjxDateFormat.parse(pattern, dateStr)
Parse a date.
<static>  
AjxDateFormat.parseTime(timeStr)
Parses the given time using one of the AjxDateFormat._timeParsers, which are regexes defined in the properties
Class Detail
AjxDateFormat(pattern)
The AjxDateFormat class formats Date objects according to a specified pattern. The patterns are defined the same as the SimpleDateFormat class in the Java libraries. Note: Only the Gregorian Calendar is supported at this time. Supporting other calendars would require a lot more information downloaded to the client. Limiting dates to the Gregorian calendar is a trade-off.

Note: The date format differs from the Java patterns a few ways: the pattern "EEEEE" (5 'E's) denotes a short weekday and the pattern "MMMMM" (5 'M's) denotes a short month name. This matches the extended pattern found in the Common Locale Data Repository (CLDR) found at: http://www.unicode.org/cldr/.

Parameters:
{string} pattern
The date format pattern.
Field Detail
<static> AjxDateFormat.DEFAULT
Default date/time format style.

<static> AjxDateFormat.FULL
Full date/time format style.

<static> AjxDateFormat.LONG
Long date/time format style.

<static> AjxDateFormat.MEDIUM
Medium date/time format style.

<static> AjxDateFormat.NUMBER
Number date .

<static> AjxDateFormat.SHORT
Short date/time format style.
Method Detail
<static> {string} AjxDateFormat.format(pattern, date)
Format a date. Equivalent to new AjxDateFormat(pattern).format(date).
Parameters:
{string} pattern
The format.
{Date} date
The date to format.
Returns:
{string} The formatted string.

<static> {AjxDateFormat} AjxDateFormat.getDateInstance(style)
Get a date formatter.
Parameters:
style
The format style.
Returns:
{AjxDateFormat} The date formatter.
See:

<static> {AjxDateFormat} AjxDateFormat.getDateTimeInstance(dateStyle, timeStyle)
Get a date and time formatter.
Parameters:
dateStyle
The format style for the date.
timeStyle
The format style for the time.
Returns:
{AjxDateFormat} The date and time formatter.
See:

<static> {AjxDateFormat} AjxDateFormat.getTimeInstance(style)
Get a time formatter.
Parameters:
style
The format style.
Returns:
{AjxDateFormat} The time formatter.
See:

{Date} parse(s)
Parses the given string and returns a date. If the string cannot be parsed as a date, null is returned.
Parameters:
{string} s
The string to parse.
Returns:
{Date} The parsed date object.

<static> {Date} AjxDateFormat.parse(pattern, dateStr)
Parse a date. Equivalent to new AjxDateFormat(pattern).parse(dateStr).
Parameters:
{string} pattern
The format.
{string} dateStr
The input string to parse.
Returns:
{Date} The parsed date object.

<static> AjxDateFormat.parseTime(timeStr)
Parses the given time using one of the AjxDateFormat._timeParsers, which are regexes defined in the properties
Parameters:
timeStr

Documentation generated by JsDoc Toolkit 2.3.0 on Tue Jun 28 2016 21:01:30 GMT-0400 (EDT)