Constructor
new module:br-parsing /Date Parser()
- Implements:
- Deprecated:
- The functionality provided by this parser can be achieved more reliably with
module:br-parsing/LocalisedDateParser
- The functionality provided by this parser can be achieved more reliably with
Methods
is Single Use Parser()
Allows parsers that should only run a single time, and that should not repeatedly re-parse their own output.
This method is optional. Parsers that don't implement it are not considered to be single-use parsers by default.
- Implements:
parse(vValue, mAttributes) → {string}
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:
European: d-m-Y, d-m-Y, d-M-Y, d-M-Y, d-m
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
vValue |
string | Date | the date to parse. |
||||||||||||||||||||||||||||||
mAttributes |
object |
the map of attributes. Properties
|
- Implements:
Returns:
the date, expressed in the output format
- Type
- string