DateParser
is typically used in the XML Renderer Framework, but can be invoked programmatically
as in the following example which evaluates to "08-Sep-2000"
caplin.element.parser.DateParser.parse("09/08/2000", {american:"true", outputFormat:"d-M-Y"})
See caplin.element.formatter.DateFormatter for the complementary formatter.
Attributes | Name and Description |
---|---|
|
caplin.element.parser.DateParser()
|
Attributes | Name and Description |
---|---|
|
String
parse(Variant vValue, Map mAttributes)
Matches a date string and converts it to a specified output format. |
►
caplin.element.parser.DateParser()
►
String
parse(Variant vValue, Map mAttributes)
Matches a date string and converts it to a specified output format.
In order to match the date, either a list of explicit inputFormats
can be supplied, or
an american
indicator can be used against a set of standard formats, which are as follows:
Attribute Options:
Option | Description |
---|---|
american | if true, dates are assumed to be in American format, i.e. month before date (defaults to false) |
separators | a set of admissible separator characters (defaults to "/.-") |
inputFormats | a comma separated list of admissible input formats |
outputFormat | the output date format |
Variant | vValue | the date to parse (String). |
Map | mAttributes | the map of attributes. |